-
Notifications
You must be signed in to change notification settings - Fork 360
feat: add slash commands for agent switching #2790
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
50a288d
feat: add slash commands for agent switching
dgageot 0194fd1
feat(coder): add /plan command for agent switching
dgageot c59a279
fix: resolve command before switching agent to prevent lookup failures
dgageot 202c498
Address PR review feedback for agent-switching commands
dgageot 68b8555
Fix agent-switching command bugs in CLI and TUI paths
dgageot ac1c1a9
Fix gci linter issue: remove extra blank line in runner_test.go
dgageot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| #!/usr/bin/env docker agent run | ||
|
|
||
| # This example demonstrates slash commands that switch the active agent. | ||
| # Type "/plan" in the TUI to hand the conversation off to the planner sub-agent, | ||
| # "/review" to switch to the reviewer, and "/back" to return to the root agent. | ||
| # | ||
| # Anything typed after the slash command (e.g. "/plan add a logout button") is | ||
| # forwarded as the first user prompt to the target agent. | ||
|
|
||
| models: | ||
| claude: | ||
| provider: anthropic | ||
| model: claude-sonnet-4-5 | ||
|
|
||
| agents: | ||
| root: | ||
| model: claude | ||
| description: The default agent. Implements the work once a plan exists. | ||
| instruction: | | ||
| You are the implementation agent. You write and edit code. | ||
| If the user asks for a plan or design discussion, use the /plan command | ||
| to switch to the planner sub-agent. | ||
| sub_agents: | ||
| - planner | ||
| - reviewer | ||
| toolsets: | ||
| - type: filesystem | ||
| - type: shell | ||
| commands: | ||
| plan: | ||
| description: "Hand off to the planner sub-agent" | ||
| agent: planner | ||
| review: | ||
| description: "Hand off to the reviewer sub-agent" | ||
| agent: reviewer | ||
|
|
||
| planner: | ||
| model: claude | ||
| description: Plans the work before implementation. | ||
| instruction: | | ||
| You are the planning agent. Ask clarifying questions, then produce a | ||
| step-by-step plan in markdown. Do not write code. | ||
| sub_agents: | ||
| - root | ||
| commands: | ||
| back: | ||
| description: "Return to the root agent" | ||
| agent: root | ||
|
|
||
| reviewer: | ||
| model: claude | ||
| description: Reviews local changes for quality and security. | ||
| instruction: | | ||
| You review the local Git changes and provide concise, actionable feedback | ||
| on code quality, security, and maintainability. | ||
| sub_agents: | ||
| - root | ||
| toolsets: | ||
| - type: shell | ||
| commands: | ||
| back: | ||
| description: "Return to the root agent" | ||
| agent: root |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.