From 0cd9f47ff134b1004bec1881d61a3ebe13f9556b Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Mon, 12 Oct 2026 03:51:49 +0000 Subject: [PATCH] fix(setup): disclose remote-key removal in the approval plan A local command entry still drops stale remote-server keys and off switches. The plan now says those fields are removed, and that Grok Build keeps its entry disabled flag. --- src/application/Setup.planning.test.ts | 24 +++++++++++++++++++++++- src/application/SetupPlan.ts | 6 +++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/application/Setup.planning.test.ts b/src/application/Setup.planning.test.ts index 3f4bd7069..8c008ead2 100644 --- a/src/application/Setup.planning.test.ts +++ b/src/application/Setup.planning.test.ts @@ -153,12 +153,34 @@ describe("setup workflow", () => { "configure_client:codex", ]); expect(result.plannedActions[0]?.detail).toContain( - "replaced when that entry is remote", + "Remote-server keys and switches that turn the server off are removed", ); expect(host.hopperInstalls).toBe(0); expect(host.configurations).toBe(0); }); + it("keeps Grok Build's entry disabled flag in the approval plan", async () => { + const host = new FakeSetupHost(); + host.hopper = "/Applications/Hopper"; + host.skill = "unchanged"; + host.clients = [ + { + name: "grok_build", + displayName: "Grok Build", + configPath: "/grok.toml", + }, + ]; + + const result = await runSetup( + { ...options(false), dryRun: true, clientIds: ["grok_build"] }, + host, + ); + + expect(result.plannedActions[0]?.detail).toContain( + "the entry disabled flag is kept", + ); + }); + it("installs Hopper when unattended authorization is explicit", async () => { const host = new FakeSetupHost("linux"); host.distribution = { diff --git a/src/application/SetupPlan.ts b/src/application/SetupPlan.ts index b333f908e..a4e2c935b 100644 --- a/src/application/SetupPlan.ts +++ b/src/application/SetupPlan.ts @@ -259,6 +259,7 @@ const setupPlan = (input: { label: client.displayName ?? client.name, target: client.configPath, detail: clientConfigurationDetail( + client.name, client.displayName ?? client.name, input.command, input.providerEnvironment, @@ -303,6 +304,7 @@ const majorVersion = (version: string): number => Number.parseInt(version.split(".")[0] ?? "0", 10); const clientConfigurationDetail = ( + clientName: string, client: string, command: readonly string[], environment: SetupProviderEnvironment, @@ -312,7 +314,9 @@ const clientConfigurationDetail = ( .sort(([left], [right]) => compareUnicodeCodePoints(left, right)) .map(([name, value]) => `${name}=${value}`); const retainedFields = - "Other fields are retained on an existing local command entry and replaced when that entry is remote."; + clientName === "grok_build" + ? "On an existing local command entry, other fields are retained. Remote-server keys and an enabled: false switch are removed; the entry disabled flag is kept. When that entry is remote, its other fields are replaced." + : "On an existing local command entry, other fields are retained. Remote-server keys and switches that turn the server off are removed. When that entry is remote, its other fields are replaced."; const environmentDetail = entries.length === 0 ? ` No additional provider environment variables. Existing server environment overrides are retained. ${retainedFields}`