fix(model-fallback): apply transformModelForProvider in getNextFallback
The getNextFallback function returned raw model names from the hardcoded fallback chain without transforming them for the target provider. For example, github-copilot requires dot notation (claude-sonnet-4.6) but the fallback chain stores hyphen notation (claude-sonnet-4-6). The background-agent retry handler already calls transformModelForProvider correctly, but the sync chat.message hook in model-fallback was missing it — a copy-paste omission. Add transformModelForProvider call in getNextFallback and a test verifying github-copilot model name transformation.
This commit is contained in:
@@ -3,6 +3,7 @@ import { getAgentConfigKey } from "../../shared/agent-display-names"
|
||||
import { AGENT_MODEL_REQUIREMENTS } from "../../shared/model-requirements"
|
||||
import { readConnectedProvidersCache, readProviderModelsCache } from "../../shared/connected-providers-cache"
|
||||
import { selectFallbackProvider } from "../../shared/model-error-classifier"
|
||||
import { transformModelForProvider } from "../../shared/provider-model-id-transform"
|
||||
import { log } from "../../shared/logger"
|
||||
import { getTaskToastManager } from "../../features/task-toast-manager"
|
||||
import type { ChatMessageInput, ChatMessageHandlerOutput } from "../../plugin/chat-message"
|
||||
@@ -145,7 +146,7 @@ export function getNextFallback(
|
||||
|
||||
return {
|
||||
providerID,
|
||||
modelID: fallback.model,
|
||||
modelID: transformModelForProvider(providerID, fallback.model),
|
||||
variant: fallback.variant,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user