Skip to content

Commit 800c4f8

Browse files
authored
fix(core): resolve model via switch_to_mode in ensure_current_mode (#319)
Ensure default-mode initialization applies agent-specific model precedence instead of falling back to top-level model when current_mode is first set.
1 parent 21754dc commit 800c4f8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lua/opencode/core.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,10 +518,10 @@ M.ensure_current_mode = Promise.async(function()
518518

519519
-- Try to use the configured default mode if it's available
520520
if default_mode and vim.tbl_contains(available_agents, default_mode) then
521-
state.current_mode = default_mode
521+
return M.switch_to_mode(default_mode):await()
522522
else
523523
-- Fallback to first available agent
524-
state.current_mode = available_agents[1]
524+
return M.switch_to_mode(available_agents[1]):await()
525525
end
526526
end
527527
return true

0 commit comments

Comments
 (0)