You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(agent): prevent hidden agents from switching the active mode (#382)
* fix(agent): prevent hidden agents from becoming the active mode
When a slash command uses a custom hidden agent, the plugin was
switching the global current_mode to that hidden agent. Since hidden
agents are filtered from the mode picker and M-m cycle, the user
would get stuck with no way to switch back.
The OpenCode TUI handles this by only switching mode when the agent
is visible (not hidden). Match that behavior in both code paths that
set the mode:
- messaging.send_message: check agent against visible agents list
before calling set_mode
- agent_model.initialize_current_model: skip restoring mode from
messages when the message's agent is hidden
* fix(agent): switch mode for visible agents when running user commands
run_user_command sends commands via api_client:send_command which
bypasses messaging.send_message, so the mode was never updated
when a command specified a visible agent. Call switch_to_mode
before sending the command so visible agents switch the mode
(matching TUI behavior), while hidden agents are silently skipped
by switch_to_mode's existing validation.
0 commit comments