From 874ec049cbc34bb6f264b0049643ef28299dce30 Mon Sep 17 00:00:00 2001 From: Benjamin Jesuiter Date: Tue, 17 Feb 2026 10:42:26 +0100 Subject: [PATCH] Configure: prioritize Keep existing auth option --- src/commands/auth-choice-prompt.test.ts | 1 + src/commands/auth-choice-prompt.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/commands/auth-choice-prompt.test.ts b/src/commands/auth-choice-prompt.test.ts index d393856e81..8f932c0be7 100644 --- a/src/commands/auth-choice-prompt.test.ts +++ b/src/commands/auth-choice-prompt.test.ts @@ -67,6 +67,7 @@ describe("auth choice keep existing", () => { } if (params.message === "OpenAI auth method") { const keepExisting = params.options.find((option) => option.value === "skip"); + expect(params.options[0]?.value).toBe("skip"); expect(keepExisting?.label).toBe("Keep existing"); expect(keepExisting?.hint).toContain("APIKey:"); expect(keepExisting?.hint).toContain("OAuth:"); diff --git a/src/commands/auth-choice-prompt.ts b/src/commands/auth-choice-prompt.ts index d5d008dc59..62f9c06b4d 100644 --- a/src/commands/auth-choice-prompt.ts +++ b/src/commands/auth-choice-prompt.ts @@ -115,8 +115,8 @@ export async function promptAuthChoiceGrouped(params: { ? buildKeepExistingOption({ group, store: params.store }) : undefined; const methodOptions: Array<{ value: string; label: string; hint?: string }> = [ - ...group.options, ...(keepExistingOption ? [keepExistingOption] : []), + ...group.options, { value: BACK_VALUE, label: "Back" }, ];