CLI: reset remote URL after trust decline (#57828)

Co-authored-by: zsxsoft <git@zsxsoft.com>
This commit is contained in:
Jacob Tomlinson
2026-03-30 12:03:06 -07:00
committed by GitHub
parent ad77666054
commit 2a75416634
2 changed files with 4 additions and 1 deletions

View File

@@ -138,7 +138,7 @@ describe("promptRemoteGatewayConfig", () => {
const manualUrl = "wss://manual.example.com:18789";
const text: WizardPrompter["text"] = vi.fn(async (params) => {
if (params.message === "Gateway WebSocket URL") {
expect(params.initialValue).toBe("wss://evil.example:443");
expect(params.initialValue).toBe("ws://127.0.0.1:18789");
return manualUrl;
}
return "";

View File

@@ -132,6 +132,9 @@ export async function promptRemoteGatewayConfig(
].join("\n"),
"Direct remote",
);
} else {
// Clear the discovered endpoint so the manual prompt falls back to a safe default.
suggestedUrl = DEFAULT_GATEWAY_URL;
}
} else {
suggestedUrl = DEFAULT_GATEWAY_URL;