From abf5e243c4d2cae03404b6e1fb1ccc77be917b53 Mon Sep 17 00:00:00 2001 From: morluto <76467478+morluto@users.noreply.github.com> Date: Sat, 10 Oct 2026 04:58:26 +0800 Subject: [PATCH] fix(update): preserve disabled client registrations --- src/application/UpdateMaintenance.ts | 6 ++++-- .../process-global/updateMaintenance.test.ts | 21 +++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/application/UpdateMaintenance.ts b/src/application/UpdateMaintenance.ts index bc12c9a9a..c0703eefe 100644 --- a/src/application/UpdateMaintenance.ts +++ b/src/application/UpdateMaintenance.ts @@ -7,6 +7,7 @@ import { isOwnedClientRegistrationCommand } from "./ClientRegistrationIdentity.j import { readClientRegistrationStatuses } from "./ClientRegistrationStatus.js"; import { clientServerForcedEnabled, + clientServerListedDisabled, effectiveClientServer, parseClientConfiguration, } from "./ClientConfigurationDocument.js"; @@ -77,11 +78,12 @@ export const existingMaintenanceScope = async ( disabled: z.boolean().optional(), }) .parse(effectiveClientServer(parsed, PRODUCT_IDENTITY.mcpServerKey)); - // OMP's enabledServers allowlist runs an entry marked `enabled: false`. + // Root disable lists override enabled entries and OMP's force-on allowlist. if ( (enabled.enabled !== false || clientServerForcedEnabled(parsed, PRODUCT_IDENTITY.mcpServerKey)) && - enabled.disabled !== true + enabled.disabled !== true && + !clientServerListedDisabled(parsed, PRODUCT_IDENTITY.mcpServerKey) ) clients.push(client.name); } diff --git a/tests/process-global/updateMaintenance.test.ts b/tests/process-global/updateMaintenance.test.ts index 568629719..bdda28912 100644 --- a/tests/process-global/updateMaintenance.test.ts +++ b/tests/process-global/updateMaintenance.test.ts @@ -100,6 +100,27 @@ describe("OMP integration maintenance", () => { existingMaintenanceScope(home, entryPoint, process.env), ).resolves.toMatchObject({ clients: ["omp"] }); }); + + it("preserves Grok Build disabled_mcp_servers during maintenance planning", async () => { + const registration = `[mcp_servers.rea]\ncommand = ${JSON.stringify(process.execPath)}\nargs = [${JSON.stringify(entryPoint)}, "mcp"]\nstartup_timeout_sec = 30\n`; + const configPath = await writeClient( + "grok_build", + `disabled_mcp_servers = ["rea", "other"]\n${registration}`, + ); + await expect( + existingMaintenanceScope(home, entryPoint, process.env), + ).resolves.toMatchObject({ clients: [] }); + expect(await readFile(configPath, "utf8")).toContain( + 'disabled_mcp_servers = ["rea", "other"]', + ); + await writeFile( + configPath, + `disabled_mcp_servers = ["other"]\n${registration}`, + ); + await expect( + existingMaintenanceScope(home, entryPoint, process.env), + ).resolves.toMatchObject({ clients: ["grok_build"] }); + }); }); describe("existing REA integration maintenance", () => {