Custom commands with agents should(?) change to the agent session.
Description
Currently, when a custom command with a primary agent is executed, the session is not changed, which prevents further interactive conversations with it, unless the user manually changes to the agent configured in the command.
This behavior has been described in #3222 and #2315
OpenCode version
No response
Steps to reproduce
- Create an agent named
myagentwith:
mode: primary
- Create a custom command:
command: mycmd
agent: myagent
subtask: false
- Trigger the command with
/mycmd - Observe the session has not changed to
myagent
Screenshot and/or share link
No response
Operating System
No response
Terminal
No response
This issue might be a duplicate of existing issues. Please check:
- #3222: [CLOSED] interactive conversation with an agent - Describes the same problem where agent execution falls back to the default/plan agent after initial interaction
- #2315: [CLOSED] Custom commands with agents should(?) run in isolated sessions - Describes similar behavior with custom commands not changing to the specified agent session, includes proposed solutions like
subtaskparameter
Feel free to ignore if none of these address your specific case.
will fix
+1. Should be fixed soon!
I look forward to this change as I default to interactive workflows, but also think we should make consider a system of allowing for agent changing and permissioning around it like Kilo Code does. Its architect agent can ask you to switch to the coding agent when it feels you have finished making decision with it so it can get to work.