Skip to content

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

@JtMotoX

Description

@JtMotoX

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I am describing a concrete problem or use case, not just a vague idea.

Area

packages/contracts or packages/shared (affects contracts, server, and web)

Problem or use case

OpenCode uses mod+. to cycle through available agents (e.g. Build, Plan). T3 Code supports agent selection via the traits dropdown, but there is no keyboard shortcut to cycle agents without opening the menu. When switching agents frequently during a session, reaching for the mouse each time breaks flow.

Proposed solution

Add an agent.cycle keybinding command bound to mod+. by default (when not in terminal focus). When triggered, it cycles to the next agent in the model's agentOptions list, wrapping from the last back to the first. No-ops when fewer than 2 agents are available.

Why this matters

Users coming from OpenCode expect mod+. to cycle agents. This is a small ergonomic improvement that keeps keyboard-driven workflows smooth when switching between agent modes.

Smallest useful scope

Register agent.cycle as a keybinding command, add a default mod+. binding, and handle it in the existing ChatView keydown handler by advancing the agent option on the current provider's model.

Alternatives considered

Manually selecting the agent from the traits dropdown menu each time. Works but is slower for frequent switching.

Risks or tradeoffs

mod+. may conflict with browser or OS shortcuts on some platforms (e.g. Ctrl+. opens emoji picker on some Linux DEs). The when: "!terminalFocus" guard limits scope. The command is a no-op for providers/models without agent options, so there's no risk of unexpected behavior.

Examples or references

OpenCode uses mod+. for the same purpose. See the OpenCode keybinding defaults.

Contribution

  • I would be open to helping implement this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions