fix: keep Moonshot CN base URL in onboarding (#7180) (thanks @waynelwz)

This commit is contained in:
Peter Steinberger
2026-02-03 21:58:04 -08:00
parent 1c6b25ddbb
commit 4a5d368926
5 changed files with 163 additions and 11 deletions

View File

@@ -18,6 +18,7 @@ import {
applyMoonshotConfig,
applyMoonshotConfigCn,
applyMoonshotProviderConfig,
applyMoonshotProviderConfigCn,
applyOpencodeZenConfig,
applyOpencodeZenProviderConfig,
applyOpenrouterConfig,
@@ -314,7 +315,7 @@ export async function applyAuthChoiceApiProviders(
setDefaultModel: params.setDefaultModel,
defaultModel: MOONSHOT_DEFAULT_MODEL_REF,
applyDefaultConfig: applyMoonshotConfigCn,
applyProviderConfig: (cfg) => applyMoonshotProviderConfigCnShim(cfg),
applyProviderConfig: applyMoonshotProviderConfigCn,
noteAgentModel,
prompter: params.prompter,
});
@@ -324,14 +325,6 @@ export async function applyAuthChoiceApiProviders(
return { config: nextConfig, agentModelOverride };
}
function applyMoonshotProviderConfigCnShim(
cfg: Parameters<typeof applyMoonshotProviderConfig>[0],
) {
// For now, provider-level CN behavior is fully handled inside applyMoonshotConfigCn.
// Keep a thin shim to satisfy the applyDefaultModelChoice signature.
return applyMoonshotProviderConfig(cfg);
}
if (authChoice === "kimi-code-api-key") {
let hasCredential = false;
const tokenProvider = params.opts?.tokenProvider?.trim().toLowerCase();