fix(agents): exclude subagents from UI model selection override
Subagents (explore, librarian, oracle, etc.) now use their own fallback chain instead of inheriting the UI-selected model. This fixes the issue where explore agent was incorrectly using Opus instead of Haiku. - Add AgentMode type and static mode property to AgentFactory - Each agent declares its own mode via factory.mode = MODE pattern - createBuiltinAgents() checks source.mode before passing uiSelectedModel
This commit is contained in:
+3
-1
@@ -225,8 +225,10 @@ export async function createBuiltinAgents(
|
||||
const override = findCaseInsensitive(agentOverrides, agentName)
|
||||
const requirement = AGENT_MODEL_REQUIREMENTS[agentName]
|
||||
|
||||
const isPrimaryAgent = isFactory(source) && source.mode === "primary"
|
||||
|
||||
const resolution = resolveModelWithFallback({
|
||||
uiSelectedModel,
|
||||
uiSelectedModel: isPrimaryAgent ? uiSelectedModel : undefined,
|
||||
userModel: override?.model,
|
||||
fallbackChain: requirement?.fallbackChain,
|
||||
availableModels,
|
||||
|
||||
Reference in New Issue
Block a user