fix(runtime-fallback): preserve agent variant and reasoningEffort on model fallback (fixes #2621)
When runtime fallback switches to a different model, the agent's configured variant and reasoningEffort were lost because buildRetryModelPayload only extracted variant from the fallback model string itself. Now buildRetryModelPayload accepts optional agentSettings and uses the agent's variant as fallback when the model string doesn't include one. reasoningEffort is also passed through. 🤖 Generated with assistance of [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -101,7 +101,13 @@ export function createAutoRetryHelpers(deps: HookDeps) {
|
||||
return
|
||||
}
|
||||
|
||||
const retryModelPayload = buildRetryModelPayload(newModel)
|
||||
const agentSettings = resolvedAgent
|
||||
? pluginConfig?.agents?.[resolvedAgent as keyof typeof pluginConfig.agents]
|
||||
: undefined
|
||||
const retryModelPayload = buildRetryModelPayload(newModel, agentSettings ? {
|
||||
variant: agentSettings.variant,
|
||||
reasoningEffort: agentSettings.reasoningEffort,
|
||||
} : undefined)
|
||||
if (!retryModelPayload) {
|
||||
log(`[${HOOK_NAME}] Invalid model format (missing provider prefix): ${newModel}`)
|
||||
const state = sessionStates.get(sessionID)
|
||||
|
||||
Reference in New Issue
Block a user