Custom commands with agents should(?) change to the agent session. #2211

Open
opened 2026-02-16 17:34:40 -05:00 by yindo · 4 comments
Owner

Originally created by @ferrao on GitHub (Oct 21, 2025).

Originally assigned to: @rekram1-node on GitHub.

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

  1. Create an agent named myagent with:
mode: primary
  1. Create a custom command:
command: mycmd
agent: myagent
subtask: false
  1. Trigger the command with /mycmd
  2. Observe the session has not changed to myagent

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Originally created by @ferrao on GitHub (Oct 21, 2025). Originally assigned to: @rekram1-node on GitHub. ### 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 1. Create an agent named `myagent` with: ``` mode: primary ``` 2. Create a custom command: ``` command: mycmd agent: myagent subtask: false ``` 3. Trigger the command with `/mycmd` 4. Observe the session has not changed to `myagent` ### Screenshot and/or share link _No response_ ### Operating System _No response_ ### Terminal _No response_
yindo added the bug label 2026-02-16 17:34:40 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Oct 21, 2025):

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 subtask parameter

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Oct 21, 2025): 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 `subtask` parameter Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Oct 21, 2025):

will fix

@rekram1-node commented on GitHub (Oct 21, 2025): will fix
Author
Owner

@plsgivemeachane commented on GitHub (Dec 28, 2025):

+1. Should be fixed soon!

@plsgivemeachane commented on GitHub (Dec 28, 2025): +1. Should be fixed soon!
Author
Owner

@shanepadgett commented on GitHub (Dec 29, 2025):

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.

@shanepadgett commented on GitHub (Dec 29, 2025): 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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2211