From 36444295c22d6ef439ce694b6c52a544a3b99db2 Mon Sep 17 00:00:00 2001 From: A <6723574+louisgv@users.noreply.github.com> Date: Fri, 13 Feb 2026 18:57:32 +0000 Subject: [PATCH] fix: show all auth vars in agent info quick start for multi-credential clouds The `spawn ` quick start section was only showing the first auth env var when the best available cloud requires multiple credentials (e.g., UpCloud with UPCLOUD_USERNAME + UPCLOUD_PASSWORD). This left users confused about what other credentials they needed. Now iterates over all auth vars, consistent with `spawn ` info. Agent: ux-engineer Co-Authored-By: Claude Sonnet 4.5 --- .../__tests__/cloud-agent-quickstart.test.ts | 29 +++++++++++++++++++ cli/src/commands.ts | 6 ++-- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/cli/src/__tests__/cloud-agent-quickstart.test.ts b/cli/src/__tests__/cloud-agent-quickstart.test.ts index 2de2dd2e7..007880052 100644 --- a/cli/src/__tests__/cloud-agent-quickstart.test.ts +++ b/cli/src/__tests__/cloud-agent-quickstart.test.ts @@ -578,6 +578,35 @@ describe("cmdAgentInfo - Quick start auth patterns", () => { const output = getOutput(); expect(output).toContain("upcloud.com"); }); + + it("should show ALL auth env vars for multi-credential clouds", async () => { + await setupManifest(multiAuthManifest); + await cmdAgentInfo("claude"); + const output = getOutput(); + // Both vars from "UPCLOUD_USERNAME + UPCLOUD_PASSWORD" should appear + expect(output).toContain("UPCLOUD_USERNAME"); + expect(output).toContain("UPCLOUD_PASSWORD"); + }); + + it("should show URL hint only on first auth var, not repeated", async () => { + await setupManifest(multiAuthManifest); + await cmdAgentInfo("claude"); + const lines = consoleSpy.mock.calls.map((c: any[]) => c.join(" ")); + const quickStartIdx = lines.findIndex((l: string) => l.includes("Quick start")); + const afterQuickStart = lines.slice(quickStartIdx + 1); + const usernameLine = afterQuickStart.find( + (l: string) => l.includes("UPCLOUD_USERNAME") + ); + const passwordLine = afterQuickStart.find( + (l: string) => l.includes("UPCLOUD_PASSWORD") + ); + expect(usernameLine).toBeDefined(); + expect(passwordLine).toBeDefined(); + // URL hint should appear on the first auth var line + expect(usernameLine).toContain("upcloud.com"); + // URL hint should NOT be repeated on the second auth var line + expect(passwordLine).not.toContain("upcloud.com"); + }); }); describe("agent where first cloud has 'none' auth", () => { diff --git a/cli/src/commands.ts b/cli/src/commands.ts index 426dd200b..dcdd3a5e5 100644 --- a/cli/src/commands.ts +++ b/cli/src/commands.ts @@ -1380,8 +1380,10 @@ export async function cmdAgentInfo(agent: string): Promise { console.log(pc.bold("Quick start:")); console.log(formatAuthVarLine("OPENROUTER_API_KEY", "https://openrouter.ai/settings/keys")); if (authVars.length > 0) { - const hint = cloudDef.url ?? `${cloudDef.name} credential`; - console.log(formatAuthVarLine(authVars[0], hint)); + for (let i = 0; i < authVars.length; i++) { + // Only show the URL hint on the first auth var to avoid repetition + console.log(formatAuthVarLine(authVars[i], i === 0 ? cloudDef.url : undefined)); + } } console.log(` ${pc.cyan(`spawn ${agentKey} ${exampleCloud}`)}`); }