[FEATURE]: Commands can change primary agent #3975

Closed
opened 2026-02-16 17:42:09 -05:00 by yindo · 2 comments
Owner

Originally created by @shanepadgett on GitHub (Dec 29, 2025).

Originally assigned to: @thdxr on GitHub.

Feature hasn’t been suggested before

  • I’ve confirmed the feature I’m requesting hasn’t been suggested previously.

Describe the enhancement you want to request

Right now, when you run a command that launches an interactive workflow, only the first message gets routed to the agent defined in the command’s frontmatter. I’d like an optional experimental feature flag that lets commands offer to switch your primary agent to the one specified in the command’s frontmatter, but only when that agent is a primary or “all” agent.

The argument of “just make an agent instead of a command” is fair, and I agree in many cases. But sometimes I just want to stay in the built-in, well-tuned Plan or Build agents. If I fire off a workflow while I’m in a different agent, like the standard Chat agent, it would be a major convenience if the command could prompt to switch over when appropriate.

This is similar to how Kilo Code handles mode switching. Kilo goes further by letting agents automatically switch modes when another mode is clearly more suitable, with user permissions controlling whether that behavior is allowed. Starting with commands offering agent switching makes the most sense for now, but longer term, agents switching to other agents when needed could also be worth exploring.

Originally created by @shanepadgett on GitHub (Dec 29, 2025). Originally assigned to: @thdxr on GitHub. ### Feature hasn’t been suggested before - [x] I’ve confirmed the feature I’m requesting hasn’t been suggested previously. ### Describe the enhancement you want to request Right now, when you run a command that launches an interactive workflow, only the first message gets routed to the agent defined in the command’s frontmatter. I’d like an optional experimental feature flag that lets commands offer to switch your *primary* agent to the one specified in the command’s frontmatter, but only when that agent is a primary or “all” agent. The argument of “just make an agent instead of a command” is fair, and I agree in many cases. But sometimes I just want to stay in the built-in, well-tuned **Plan** or **Build** agents. If I fire off a workflow while I’m in a different agent, like the standard Chat agent, it would be a major convenience if the command could prompt to switch over when appropriate. This is similar to how Kilo Code handles mode switching. Kilo goes further by letting agents automatically switch modes when another mode is clearly more suitable, with user permissions controlling whether that behavior is allowed. Starting with *commands offering agent switching* makes the most sense for now, but longer term, agents switching to other agents when needed could also be worth exploring.
yindo added the discussion label 2026-02-16 17:42:09 -05:00
yindo closed this issue 2026-02-16 17:42:09 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Dec 29, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #3329: Custom commands with agents should(?) change to the agent session.

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

@github-actions[bot] commented on GitHub (Dec 29, 2025): This issue might be a duplicate of existing issues. Please check: - #3329: Custom commands with agents should(?) change to the agent session. Feel free to ignore if none of these address your specific case.
Author
Owner

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

Disregard, looks like 3329 addresses this and will hopefully be fixed soon.

@shanepadgett commented on GitHub (Dec 29, 2025): Disregard, looks like 3329 addresses this and will hopefully be fixed soon.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3975