From 13b499328926d24666744252cb0c50fcc82cc94b Mon Sep 17 00:00:00 2001 From: joshavant <830519+joshavant@users.noreply.github.com> Date: Sat, 21 Feb 2026 17:08:34 -0800 Subject: [PATCH] Onboard non-interactive: avoid rewriting profile-backed keys --- .../onboard-non-interactive/local/auth-choice.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/commands/onboard-non-interactive/local/auth-choice.ts b/src/commands/onboard-non-interactive/local/auth-choice.ts index 68399ba2865..406394a0b54 100644 --- a/src/commands/onboard-non-interactive/local/auth-choice.ts +++ b/src/commands/onboard-non-interactive/local/auth-choice.ts @@ -344,7 +344,9 @@ export async function applyNonInteractiveAuthChoice(params: { if (!resolved) { return null; } - await setVolcengineApiKey(resolved.key); + if (resolved.source !== "profile") { + await setVolcengineApiKey(resolved.key); + } nextConfig = applyAuthProfileConfig(nextConfig, { profileId: "volcengine:default", provider: "volcengine", @@ -365,7 +367,9 @@ export async function applyNonInteractiveAuthChoice(params: { if (!resolved) { return null; } - await setByteplusApiKey(resolved.key); + if (resolved.source !== "profile") { + await setByteplusApiKey(resolved.key); + } nextConfig = applyAuthProfileConfig(nextConfig, { profileId: "byteplus:default", provider: "byteplus", @@ -409,7 +413,9 @@ export async function applyNonInteractiveAuthChoice(params: { if (!resolved) { return null; } - await setOpenaiApiKey(resolved.key); + if (resolved.source !== "profile") { + await setOpenaiApiKey(resolved.key); + } nextConfig = applyAuthProfileConfig(nextConfig, { profileId: "openai:default", provider: "openai",