File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -85,14 +85,11 @@ function M.get_opencode_agents()
8585 end
8686 end
8787
88- -- Sort the agents before prepending the default agents
8988 table.sort (agents )
9089
91- -- Only add build/plan as fallbacks if they're not explicitly disabled in config
9290 for _ , mode in ipairs ({ ' plan' , ' build' }) do
9391 if not vim .tbl_contains (agents , mode ) then
9492 local mode_config = cfg .agent and cfg .agent [mode ]
95- -- Only add if not explicitly disabled or if no config exists (default behavior)
9693 if mode_config == nil or (mode_config .disable ~= true ) then
9794 table.insert (agents , 1 , mode )
9895 end
Original file line number Diff line number Diff line change @@ -312,6 +312,11 @@ function M.switch_to_mode(mode)
312312 end
313313
314314 state .current_mode = mode
315+ local agents_config = config_file .get_opencode_config ().agent or {}
316+ local mode_config = agents_config [mode ] or {}
317+ if mode_config .model and mode_config .model ~= ' ' then
318+ state .current_model = mode_config .model
319+ end
315320 return true
316321end
317322
You can’t perform that action at this time.
0 commit comments