Skip to content

feat(keybindings): add mod+. shortcut to cycle agent trait#2300

Open
JtMotoX wants to merge 3 commits intopingdotgg:mainfrom
JtMotoX:feat/agent-cycle-keybinding
Open

feat(keybindings): add mod+. shortcut to cycle agent trait#2300
JtMotoX wants to merge 3 commits intopingdotgg:mainfrom
JtMotoX:feat/agent-cycle-keybinding

Conversation

@JtMotoX
Copy link
Copy Markdown

@JtMotoX JtMotoX commented Apr 23, 2026

What Changed

Add an agent.cycle keybinding command with a default mod+. binding (when not in terminal focus). Pressing it cycles through the available agent options (e.g. Build, Plan) for the current provider model, wrapping from last to first. No-ops when fewer than 2 agents are available.

The traits dropdown now displays the agent.cycle shortcut label next to the "Agent" section header, so users can discover the hotkey without memorizing it.

Changes across 5 files (+55 lines):

  • packages/contracts/src/keybindings.ts — add agent.cycle to static keybinding commands
  • apps/server/src/keybindings.ts — add default mod+. binding
  • apps/web/src/components/ChatView.tsx — handle agent.cycle in the existing keydown handler
  • apps/web/src/components/chat/TraitsPicker.tsx — show the agent.cycle shortcut label (e.g. ⌘.) in the traits dropdown Agent section header
  • apps/web/src/keybindings.test.ts — add test coverage for the new binding and its label rendering

Why

OpenCode uses mod+. to cycle agents. T3 Code supports agent selection via the traits dropdown but has no keyboard shortcut for it. This adds parity for keyboard-driven workflows and makes the shortcut discoverable in the UI.

Closes #2299

Screenshots

hotkey-label

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes (N/A)

Note

Add mod+. shortcut to cycle agent trait in the composer

  • Adds agent.cycle to the static keybinding commands and maps mod+. to it (when the terminal is not focused) in keybindings.ts.
  • In ChatView.tsx, handling agent.cycle computes the next agent from available provider/model capabilities in a cyclic order and persists the selection with persistSticky=true.
  • The Agent section header in TraitsPicker.tsx now displays the active shortcut label (e.g. ⌘. on Mac, Ctrl+. on Linux) using the Kbd component.

Macroscope summarized ea81efa.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 23, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 9c883311-c05b-42fb-8a32-8f484ff3b6f7

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Apr 23, 2026
Comment thread apps/web/src/components/ChatView.tsx
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp Bot commented Apr 23, 2026

Approvability

Verdict: Needs human review

This PR introduces a new keyboard shortcut feature (mod+. to cycle agent traits) with new user-facing behavior and state persistence logic. New features benefit from human review to validate the interaction design and ensure the cycling logic behaves as expected across different providers and configurations.

You can customize Macroscope's approvability policy. Learn more.

Add agent.cycle keybinding command that cycles through available
agent options (e.g. Build, Plan) for the current provider model.
Preserves existing model options when switching agents.
@JtMotoX JtMotoX force-pushed the feat/agent-cycle-keybinding branch from 3bf472f to e04472e Compare April 23, 2026 09:03
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e04472e. Configure here.

Comment thread apps/web/src/components/ChatView.tsx
@JtMotoX JtMotoX marked this pull request as draft April 23, 2026 09:20
@JtMotoX JtMotoX marked this pull request as ready for review April 23, 2026 10:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Add keybinding to cycle agent trait (mod+.)

1 participant