opencode icon indicating copy to clipboard operation
opencode copied to clipboard

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

Open ferrao opened this issue 2 months ago • 4 comments

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

ferrao avatar Oct 21 '25 15:10 ferrao

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] avatar Oct 21 '25 15:10 github-actions[bot]

will fix

rekram1-node avatar Oct 21 '25 16:10 rekram1-node

+1. Should be fixed soon!

plsgivemeachane avatar Dec 28 '25 11:12 plsgivemeachane

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 avatar Dec 29 '25 19:12 shanepadgett