Skip to content

feat(cli): add /agents command for switching between known agents#1467

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/add-agents-functionality-cli
Draft

feat(cli): add /agents command for switching between known agents#1467
Copilot wants to merge 2 commits intomainfrom
copilot/add-agents-functionality-cli

Conversation

Copy link
Contributor

Copilot AI commented Feb 20, 2026

The CLI lacked an in-session way to switch between known agents. Users had to restart the CLI with -a to change agents.

Changes

New widget: AgentSelectorScreen

  • Modal screen (/agents) mirroring the UX of /threads and /model selectors
  • Scans ~/.deepagents/ for subdirectories with AGENTS.md and presents them as a navigable list
  • Keyboard navigation: //j/k, Page Up/Down, Enter to confirm, Esc to cancel
  • Current agent pre-highlighted; empty-state message when no agents are found

app.py: agent switching logic

  • _show_agent_selector() — pushes the modal, wires dismiss callback
  • _switch_agent(agent_name) — recreates the agent graph with the new assistant_id using the current model, clears the conversation, resets to a fresh thread
    • No-op with message when already on the selected agent
    • Graceful fallback (preference message) when no checkpointer is available for hot-swap

Autocomplete + help

  • /agents added to SLASH_COMMANDS for tab-completion
  • Listed in /help output

AI disclaimer

This PR was created with the assistance of GitHub Copilot coding agent.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Add /agents functionality to CLI app for agent swapping feat(cli): add /agents command for switching between known agents Feb 20, 2026
Comment on lines +1955 to +1956
Recreates the agent with the new `assistant_id`, clears the current
conversation, starts a fresh thread, and updates the UI.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this the intended behavior? no hot-swapping agent's mid convo?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants