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.
This commit is contained in:
committed by
xeropresence
parent
502e665212
commit
0cd9f47ff1
@@ -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 = {
|
||||
|
||||
@@ -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}`
|
||||
|
||||
Reference in New Issue
Block a user