From 7a9deb2400601e28cb173e50de76f780b6611712 Mon Sep 17 00:00:00 2001 From: ideoutrea Date: Fri, 6 Feb 2026 18:13:42 +0800 Subject: [PATCH] Resolve conflicts --- src/commands/auth-choice-options.ts | 2 +- .../local/auth-choice.ts | 21 ++++++++++++------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/commands/auth-choice-options.ts b/src/commands/auth-choice-options.ts index cece3f4e2..1b2514fa7 100644 --- a/src/commands/auth-choice-options.ts +++ b/src/commands/auth-choice-options.ts @@ -23,7 +23,7 @@ export type AuthChoiceGroupId = | "synthetic" | "venice" | "qwen" - | "qianfan"; + | "qianfan" | "xai"; export type AuthChoiceGroup = { diff --git a/src/commands/onboard-non-interactive/local/auth-choice.ts b/src/commands/onboard-non-interactive/local/auth-choice.ts index e34e62d40..62c7fe8ed 100644 --- a/src/commands/onboard-non-interactive/local/auth-choice.ts +++ b/src/commands/onboard-non-interactive/local/auth-choice.ts @@ -229,13 +229,6 @@ export async function applyNonInteractiveAuthChoice(params: { flagValue: opts.qianfanApiKey, flagName: "--qianfan-api-key", envVar: "QIANFAN_API_KEY", - if (authChoice === "xai-api-key") { - const resolved = await resolveNonInteractiveApiKey({ - provider: "xai", - cfg: baseConfig, - flagValue: opts.xaiApiKey, - flagName: "--xai-api-key", - envVar: "XAI_API_KEY", runtime, }); if (!resolved) { @@ -250,7 +243,19 @@ export async function applyNonInteractiveAuthChoice(params: { mode: "api_key", }); return applyQianfanConfig(nextConfig); - setXaiApiKey(resolved.key); + } + + if (authChoice === "xai-api-key") { + const resolved = await resolveNonInteractiveApiKey({ + provider: "xai", + cfg: baseConfig, + flagValue: opts.xaiApiKey, + flagName: "--xai-api-key", + envVar: "XAI_API_KEY", + runtime, + }); + if (!resolved) { + return null; } nextConfig = applyAuthProfileConfig(nextConfig, { profileId: "xai:default",