Resolve conflicts

This commit is contained in:
ideoutrea
2026-02-06 18:13:42 +08:00
parent 3997316fb0
commit 7a9deb2400
2 changed files with 14 additions and 9 deletions

View File

@@ -23,7 +23,7 @@ export type AuthChoiceGroupId =
| "synthetic" | "synthetic"
| "venice" | "venice"
| "qwen" | "qwen"
| "qianfan"; | "qianfan"
| "xai"; | "xai";
export type AuthChoiceGroup = { export type AuthChoiceGroup = {

View File

@@ -229,13 +229,6 @@ export async function applyNonInteractiveAuthChoice(params: {
flagValue: opts.qianfanApiKey, flagValue: opts.qianfanApiKey,
flagName: "--qianfan-api-key", flagName: "--qianfan-api-key",
envVar: "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, runtime,
}); });
if (!resolved) { if (!resolved) {
@@ -250,7 +243,19 @@ export async function applyNonInteractiveAuthChoice(params: {
mode: "api_key", mode: "api_key",
}); });
return applyQianfanConfig(nextConfig); 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, { nextConfig = applyAuthProfileConfig(nextConfig, {
profileId: "xai:default", profileId: "xai:default",