fix: align sync fallback chain, fix model-fallback test determinism
- Hoist resolveFallbackChainForCallOmoAgent before sync/background branch so sync executor also receives the fallback chain - Add fallbackChain parameter to sync-executor with setSessionFallbackChain - Mock connected-providers-cache in event.model-fallback tests for deterministic behavior (no dependency on local cache files) - Update test expectations to account for no-op fallback skip when normalized current model matches first fallback entry - Add cache spy isolation for subagent-resolver fallback_models tests
This commit is contained in:
@@ -82,19 +82,20 @@ export function createCallOmoAgent(
|
||||
return `Error: Agent "${normalizedAgent}" is disabled via disabled_agents configuration. Remove it from disabled_agents in your oh-my-opencode.json to use it.`
|
||||
}
|
||||
|
||||
const fallbackChain = resolveFallbackChainForCallOmoAgent({
|
||||
subagentType: args.subagent_type,
|
||||
agentOverrides,
|
||||
userCategories,
|
||||
})
|
||||
|
||||
if (args.run_in_background) {
|
||||
if (args.session_id) {
|
||||
return `Error: session_id is not supported in background mode. Use run_in_background=false to continue an existing session.`
|
||||
}
|
||||
const fallbackChain = resolveFallbackChainForCallOmoAgent({
|
||||
subagentType: args.subagent_type,
|
||||
agentOverrides,
|
||||
userCategories,
|
||||
})
|
||||
return await executeBackground(args, toolCtx, backgroundManager, ctx.client, fallbackChain)
|
||||
}
|
||||
|
||||
return await executeSync(args, toolCtx, ctx)
|
||||
return await executeSync(args, toolCtx, ctx, undefined, fallbackChain)
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user