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:
parent
880782b1dd
commit
e258f58fd7
|
|
@ -20,7 +20,9 @@ function getModels(initData: InitData | null): ModelInfo[] {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getProviderId(initData: InitData | null): string {
|
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 {
|
function getProviderName(initData: InitData | null): string {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user