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.
This commit is contained in:
DoSun 2026-05-08 18:40:10 +08:00
parent 880782b1dd
commit e258f58fd7

View File

@ -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 {