Skip to content

Commit 796824a

Browse files
committed
fix: ignore cosmetic Claude MCP config drift
1 parent 6aba649 commit 796824a

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

universal-refiner/scripts/operations/register-global.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ function Update-JsonConfig {
214214
)
215215

216216
$config = Read-JsonConfig $Path
217+
$originalFingerprint = $config | ConvertTo-Json -Depth 100 -Compress
217218
if ($Servers.Count -gt 0) {
218219
if (-not $config.Contains("mcpServers") -or -not ($config["mcpServers"] -is [System.Collections.IDictionary])) {
219220
$config["mcpServers"] = [ordered]@{}
@@ -227,8 +228,9 @@ function Update-JsonConfig {
227228
}
228229

229230
$desiredContent = ConvertTo-StableJson $config
231+
$desiredFingerprint = $config | ConvertTo-Json -Depth 100 -Compress
230232
$currentContent = if (Test-Path -LiteralPath $Path) { [System.IO.File]::ReadAllText($Path) } else { "" }
231-
if ($currentContent -ceq $desiredContent) {
233+
if (($currentContent -ceq $desiredContent) -or ($originalFingerprint -ceq $desiredFingerprint)) {
232234
Write-Host "OK $Name"
233235
return
234236
}

universal-refiner/tests/register-global.test.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,13 @@ describe("global registration doctor", () => {
7171

7272
const backupCount = readdirSync(root, { recursive: true }).filter((name) => name.includes("promptimprover-backup")).length;
7373
expect(backupCount).toBeGreaterThan(0);
74+
writeFileSync(join(root, ".claude.json"), JSON.stringify(claude), "utf8");
7475
const check = run(root, "-Check");
7576
expect(check.status, check.stderr || check.stdout).toBe(0);
7677
const second = run(root, "-Apply");
7778
expect(second.status, second.stderr || second.stdout).toBe(0);
7879
expect(readdirSync(root, { recursive: true }).filter((name) => name.includes("promptimprover-backup"))).toHaveLength(backupCount);
79-
}, 30_000);
80+
}, 45_000);
8081

8182
it("reports drift, mojibake, and credential field paths without printing values", () => {
8283
const root = makeRoot();

0 commit comments

Comments
 (0)