From e258f58fd739483c0564125f5bfdcdec8ee39393 Mon Sep 17 00:00:00 2001 From: DoSun Date: Fri, 8 May 2026 18:40:10 +0800 Subject: [PATCH] fix: normalize provider ID to anthropic (was firstParty causing model validation mismatch) The subprocess returns apiProvider='firstParty' for direct Anthropic access, but the adapter hardcodes providerID='anthropic' in SSE events. This mismatch causes the frontend's isModelValid check to fail, clearing the model selector. --- src/server/routes/provider.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/server/routes/provider.ts b/src/server/routes/provider.ts index e1543441d..52067c1b1 100644 --- a/src/server/routes/provider.ts +++ b/src/server/routes/provider.ts @@ -20,7 +20,9 @@ function getModels(initData: InitData | null): ModelInfo[] { } function getProviderId(initData: InitData | null): string { - return initData?.account?.apiProvider ?? 'anthropic' + const p = initData?.account?.apiProvider + if (!p || p === 'firstParty') return 'anthropic' + return p } function getProviderName(initData: InitData | null): string {