Repository navigation
refactor(agents): list supported agents in one registry - #631
Merged
Merged
Conversation
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.
This branch was successfully deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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
src/lib/agents.ts:AGENTSlists each supported agent with itsid,label,hasPlanModeandhasModelPicker;AgentKindis derived from that list;DEFAULT_AGENT,isAgentKind,toAgentKind(narrows a stored setting) andagentInfo.<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.AgentTypeunion (agentDeepLink) and theReviewAgentunion withnormalizeReviewAgent(agent-review-launch);AgentKindunion inagentCommand, which now lives inagents.ts;"claude" | "codex" | "cursor" | "copilot"unions inDashboard,TaskInput,ShowWorkspace,ResolveConflictsDialog,terminal/types,types/sessionsandapi-types-checks;=== "codex" || === "cursor" …checks, nowtoAgentKind.Claude 1,Copilot 2) useagentInfo(...).label;hasPlanMode;hasModelPicker.AgentIconsis aRecord<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 inagentCommand.ts.Not changed
"claude" | "codex" | …unions remain inWorkspaceTerminalPane/workspace-terminal-pane/types.ts, plus the Reset toast label inAgentTerminalPanel. fix(terminal): keep focus on close, relaunch without the task on model change, drop Reset #628 and refactor: remove Mission Control and dead terminal code; key agent columns "agent-<id>" #629 delete those lines, so I left them to avoid merge conflicts.commands/binary.rs), the remote supervisor allowlist (cursor-agentbinary names) and chat log parsing, andRemoteAgentIdcovers remote agents. Those are separate from agent selection.Tests
src/lib/agents.test.ts.default-agent.test.tsx: every agent picker (task input, repo Default Agent, Review Agent, app Default Agent) lists exactly theAGENTSids. With the old repo settings file it fails on the missingcopilot.normalizeReviewAgenttests;toAgentKindcovers the same cases.tsc, lint andnpm run checkare clean. Unit tests pass (799/799). The agent integration tests pass (15/15): default agent, default model, plan split button, fake agent terminal.copilot-agent-option,agent-review-settingsandagent-prompt-dialog-optionspass. I checked the task toolbar with Copilot selected: it shows Run and no Plan chevron.Generated by Claude Code