Skip to content

armgit / rea

Public Imported from GitHub
0

Reverse engineer anything with agents, from app behavior down to native binaries.

fix(update): preserve disabled client registrations

morlutoabf5e243c4d2
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", () => {