Skip to content

refactor(agents): list supported agents in one registry - #631

Merged
Ziinc merged 1 commit into
mainfrom
claude/agent-registry
Sep 29, 2026
Merged

Ziinc merged 1 commit into
mainfrom
claude/agent-registry

Conversation

@Ziinc

@Ziinc Ziinc commented Sep 29, 2026 •

Copy link
Copy Markdown
Collaborator

Each agent picker and check listed the supported agents by hand. The repo-level Default Agent and Review Agent selects had fallen behind and left out Copilot.

Change

  • New src/lib/agents.ts:
    • AGENTS lists each supported agent with its id, label, hasPlanMode and hasModelPicker;
    • AgentKind is derived from that list;
    • also exported: DEFAULT_AGENT, isAgentKind, toAgentKind (narrows a stored setting) and agentInfo.
  • New <AgentOptions> renders one <option> per agent. It is used by all four agent selects: the task input, app Default Agent, repo Default Agent and Review Agent. Copilot now appears in the two repo selects.
  • Replaced the duplicated types and checks:
    • the AgentType union (agentDeepLink) and the ReviewAgent union with normalizeReviewAgent (agent-review-launch);
    • the AgentKind union in agentCommand, which now lives in agents.ts;
    • inline "claude" | "codex" | "cursor" | "copilot" unions in Dashboard, TaskInput, ShowWorkspace, ResolveConflictsDialog, terminal/types, types/sessions and api-types-checks;
    • hand-written === "codex" || === "cursor" … checks, now toAgentKind.
  • Behaviour now read from the registry instead of name comparisons:
    • session names (Claude 1, Copilot 2) use agentInfo(...).label;
    • the Plan menu shows only for agents with hasPlanMode;
    • the terminal model picker shows only for agents with hasModelPicker.
  • AgentIcons is a Record<AgentKind, Icon>, so adding an agent without an icon fails the typecheck. An unknown stored agent still falls back to the Claude icon.
    Adding an agent now means one entry in AGENTS, an icon, and its launch command in agentCommand.ts.

Not changed

Tests

  • New src/lib/agents.test.ts.
  • New integration test in default-agent.test.tsx: every agent picker (task input, repo Default Agent, Review Agent, app Default Agent) lists exactly the AGENTS ids. With the old repo settings file it fails on the missing copilot.
  • Removed the normalizeReviewAgent tests; toAgentKind covers the same cases.
  • Checks: tsc, lint and npm run check are clean. Unit tests pass (799/799). The agent integration tests pass (15/15): default agent, default model, plan split button, fake agent terminal.
  • Screenshot specs: copilot-agent-option, agent-review-settings and agent-prompt-dialog-options pass. I checked the task toolbar with Copilot selected: it shows Run and no Plan chevron.
    Generated by Claude Code

src/lib/agents.ts now lists every agent treq can launch, with its label
and whether it has a plan mode and a model picker. Agent pickers, settings
and stored-value checks read it:

- An <AgentOptions> component renders the choices for the task input, app
  Default Agent, repo Default Agent and Review Agent selects. The two repo
  selects were missing Copilot.
- AgentKind, isAgentKind and toAgentKind replace the AgentType and
  ReviewAgent unions, normalizeReviewAgent, and the hand-written membership
  checks in Dashboard, TaskInput, ShowWorkspace and ResolveConflictsDialog.
- Session names, the Plan menu and the model picker read the label and
  capability flags instead of comparing agent names.
- Agent icons are a Record keyed by AgentKind, so an agent added without
  an icon fails the typecheck.
@Ziinc
Ziinc merged commit 246ceae into main Sep 29, 2026
20 checks passed
@Ziinc
Ziinc deleted the claude/agent-registry branch September 29, 2026 07:45

This branch was successfully deployed

1 active deployment
preview — 0ab1a9f0 Deployed Sep 29, 2026 by Ziinc via build #1474
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.

2 participants