You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(agents): add custom agents backed by an installed agent - #47662
If you run the same CLI agent (like Claude Code or Codex) through different wrapper commands — for example, one wrapper per API gateway or profile — Orca only lets you configure one command per agent today. This change adds a Custom agents card in Settings → Agents so you can save multiple named entries backed by an installed agent and launch them from the + new-tab menu while keeping all of the base agent's status hooks, prompt delivery, and session resume behavior.
What Changed
Before:Settings → Agents stores a single command override per built-in agent (agentCmdOverrides), so switching between multiple wrappers or profiles for the same harness requires either editing Settings before each launch or dropping to a raw terminal (losing agent status hooks, tab labeling, and resume support).
After:
Settings → Agents gains a Custom agents section (between Installed and Available to install) on local hosts where users can add, edit, reorder, and delete named custom entries (name, base agent, command).
Entries are persisted under customTuiAgents in GlobalSettings and normalized on both load (normalizeLoadedGlobalSettings) and save (updateSettings) — trimming fields, capping length/count, deduplicating IDs, validating base agent IDs, and collapsing line breaks so a command stays a single shell line.
The + new-tab menu lists launchable custom agents (for local workspaces whose base agent is detected or pending detection) beneath the agent rows, and the omnibox search matches them by name or command.
Launching a custom agent opens a terminal tab named after the entry (quickCommandLabel), runs its command in place of the base agent's Settings command via a per-launch launchCommand override in launchAgentInNewTab / resolveAgentStartupPlanInputs, and records that command in launchConfig.agentCommand so hibernated or restored sessions resume through the same wrapper.
Scope note: Kept deliberately focused on the core settings model, Settings UI, and + new-tab menu/search/launch path (following #8337's note to start fresh and tight against current main). Additional entry points (default custom agent, composer, mobile, source control AI) are left for follow-up PRs once the core shape looks right.
Why a per-launch command override backed by an installed TuiAgent instead of an unattached generic CLI type: Reusing the base agent preserves Orca's existing hooks, readiness detection, prompt injection, and resume logic without duplicating harness definitions or expanding the RPC/wire protocol.
Why local-only in this PR:customTuiAgents lives in local desktop settings; launchableCustomAgents skips non-local execution hosts (executionHostId !== LOCAL_EXECUTION_HOST_ID) so a local wrapper command is never sent across the wire or silently dropped by a remote host.
Headless component-fixture screenshots were captured via pnpm fixtures:shot for empty, populated, and add-dialog states of CustomTuiAgentsSection / CustomTuiAgentDialog (using Orca's SettingsGroup card layout and SettingsBadge / Button / Dialog primitives) and verified with zero console or render errors. Before/after screenshots can be attached via GitHub UI if requested (CLI upload extension is not installed locally).
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
Verified on macOS (arm64):
ORCA_CODE_QUALITY_BASE=upstream/main pnpm check:changed --base=upstream/main — all 42/42 checks passed (format, oxlint, changed-code quality, unit tests, all 4 typecheck projects, localization coverage/catalogs/extraction, dead design-system classes, import boundaries, React Compiler compat, and all ratchets).
src/shared/agent-launch/catalog/custom-tui-agents.test.ts covers persistence normalization (trimming, newline collapse, deduplication, invalid-entry dropping) and resolveAgentStartupPlanInputs + buildAgentStartupPlan verifying launchCommand replaces agentCmdOverrides for both launch and resume config.
Rendered CustomTuiAgentsSection (empty, populated, add dialog) via pnpm fixtures:shot in headless Chromium.
Performance
None, because custom-agent normalization only runs on settings load/save (bounded to 50 entries), and menu/search rows are computed only when the + new-tab menu is opened.
Risk
Level: Low
Purely additive optional customTuiAgents?: CustomTuiAgent[] field in GlobalSettings and optional launchCommand?: string on LaunchAgentInNewTabArgs / resolveAgentStartupPlanInputs; zero behavior change when no custom agents are configured.
Remote SSH / paired web hosts do not display local custom agents, avoiding broken cross-host launches or wire-protocol changes.
Back-out: a plain git revert restores prior behavior cleanly (any saved customTuiAgents key in settings JSON is harmlessly ignored if reverted).
AI Disclosure
Assisted by Antigravity (Gemini 4 Neon) and Claude Opus 5.5 for implementation, rebasing onto current main, and verification.
Review
Agent skill upstream boundary
Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.
Notes
Security:normalizeCustomTuiAgents strips/collapses \r/\n to prevent multi-line shell injection, enforces length/count bounds (MAX_CUSTOM_TUI_AGENTS = 50), validates agent via isTuiAgent, and never forwards local commands to remote hosts.
Cross-platform: Uses existing withLaunchCommandOverride / resolveAgentStartupPlanInputs pipeline, which handles POSIX and Windows shells identically to agentCmdOverrides.
Remote SSH & Mobile: Local desktop settings only in this PR; remote workspaces skip local custom agents cleanly, and mobile/RPC wire schemas are unchanged.
Backwards compatibility: Additive optional field, no migration required.
Checklist
This PR is small and focused
I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
I stated the risk: what could break, for whom, and how to back it out
Before/after screenshots or videos attached for UI changes, or N/A with reason
Self-reviewed for correctness, security, and performance
Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)
No actionable comments were generated in the recent review.
Walkthrough
The change adds custom TUI agent entries to global settings, including normalization and controls to add, edit, reorder, and delete entries. Custom agents appear in the launch menu and tab-bar picker when eligible. Their launch command overrides the selected base agent’s Settings command for that launch, which uses the terminal surface. English and Chinese translations are added.
Merge Risk: Minimal · up to ab6c8
This adds a Custom agents section in Settings, plus custom entries in the new-tab menu and picker that launch with their own command. The reviewed code shows the custom command and name carried through to the launch. No remaining merge-blocking risk was found.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "feat(agents): add custom agents backed by an installed agent" matches the main change. The PR adds a Custom agents section in Settings, persists custom entries, and launches them from the n…
Description check
The description follows the repository template closely. It covers ELI5, What Changed (before and after), Why, a linked issue (Fixes #9136), Visual Proof, Testing, Performance, Risk with a level, AI D…
Linked Issues check
Directly linked issue #9136 asks for multiple named entries backed by one harness. Its key concrete requirement is that an entry can override the launch command. The whole-PR summary (merge base to he…
Out of Scope Changes check
Each changed file in the whole-PR summary supports the custom-agent feature. These include the settings model and normalization, the custom-agent catalog and its tests, the launch command override pat…
Full details: Title check
Explanation
The title "feat(agents): add custom agents backed by an installed agent" matches the main change. The PR adds a Custom agents section in Settings, persists custom entries, and launches them from the new-tab menu through a base installed agent. The title is specific and uses a conventional commit prefix. It is 60 characters, which is acceptable.
Full details: Description check
Explanation
The description follows the repository template closely. It covers ELI5, What Changed (before and after), Why, a linked issue (Fixes #9136), Visual Proof, Testing, Performance, Risk with a level, AI Disclosure, Notes, and Checklist. Visual Proof gives a description of headless fixture screenshots but does not attach images, and the PR relies on the GitHub UI to add them later. The template asks for BEFORE and AFTER visuals for UI changes, so this part is incomplete. The Review section and the Agent skill upstream boundary checkbox are filled in. The Risk level is set to Low. Performance has a one-line reason.
Resolution
Attach the actual BEFORE and AFTER screenshots or videos for the Settings Custom agents section and the + new-tab menu, as the template requires for UI changes. The fixture descriptions alone do not satisfy this requirement.
Full details: Linked Issues check
Explanation
Directly linked issue #9136 asks for multiple named entries backed by one harness. Its key concrete requirement is that an entry can override the launch command. The whole-PR summary (merge base to head ab6c875) shows this implemented. customTuiAgents is stored in GlobalSettings and normalized on load (normalizeLoadedGlobalSettings) and save (updateSettings) through normalizeCustomTuiAgents. CustomTuiAgentsSection in Settings → Agents supports add, edit, reorder, and delete. CustomAgentMenuItems and buildCustomAgentLaunchOptions expose entries in the + new-tab menu and omnibox search. A per-launch launchCommand flows through launchAgentInNewTab and withLaunchCommandOverride into resolveAgentStartupPlanInputs, replacing the base agent's agentCmdOverrides command. The same command is recorded in launchConfig.agentCommand for resume. custom-tui-agents.test.ts covers normalization and launch and resume command selection. Gaps relative to the issue's broader proposal remain: per-entry args and env, and independent enable, disable, or set-as-default per entry. The PR description defers these. The issue's stated alternative (a separate list with a baseAgent field) matches the implemented shape. These are residual gaps, not failing requirements. Evidence basis: the whole-PR summary and the previous assessment. The incremental commits were not inspected line by line.
Full details: Out of Scope Changes check
Explanation
Each changed file in the whole-PR summary supports the custom-agent feature. These include the settings model and normalization, the custom-agent catalog and its tests, the launch command override path, the + menu, picker, and search rows, the Settings UI components, en and zh locale strings, and type updates such as NewTabAgentMenuRow.custom and launchCommand. The AgentDetectionCatalog change (afterInstalled slot and keyed fragments) is a small supporting change that places the new section between the installed and available groups. No changed file is unrelated to the feature. Evidence basis: the whole-PR summary and the previous assessment. The incremental commits were not inspected line by line.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Files skipped from review as they are similar to previous changes: 2
src/renderer/src/i18n/locales/en.json
src/renderer/src/i18n/locales/zh.json
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
+1. This covers the terminal side of what I asked for in #9136 (named Claude and Pi instances with their own command and environment). I'm looking forward to the Chat follow-up.
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
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.
ELI5
If you run the same CLI agent (like Claude Code or Codex) through different wrapper commands — for example, one wrapper per API gateway or profile — Orca only lets you configure one command per agent today. This change adds a Custom agents card in Settings → Agents so you can save multiple named entries backed by an installed agent and launch them from the
+new-tab menu while keeping all of the base agent's status hooks, prompt delivery, and session resume behavior.What Changed
Before: Settings → Agents stores a single command override per built-in agent (
agentCmdOverrides), so switching between multiple wrappers or profiles for the same harness requires either editing Settings before each launch or dropping to a raw terminal (losing agent status hooks, tab labeling, and resume support).After:
name,base agent,command).customTuiAgentsinGlobalSettingsand normalized on both load (normalizeLoadedGlobalSettings) and save (updateSettings) — trimming fields, capping length/count, deduplicating IDs, validating base agent IDs, and collapsing line breaks so a command stays a single shell line.+new-tab menu lists launchable custom agents (for local workspaces whose base agent is detected or pending detection) beneath the agent rows, and the omnibox search matches them by name or command.quickCommandLabel), runs its command in place of the base agent's Settings command via a per-launchlaunchCommandoverride inlaunchAgentInNewTab/resolveAgentStartupPlanInputs, and records that command inlaunchConfig.agentCommandso hibernated or restored sessions resume through the same wrapper.Scope note: Kept deliberately focused on the core settings model, Settings UI, and
+new-tab menu/search/launch path (following #8337's note to start fresh and tight against currentmain). Additional entry points (default custom agent, composer, mobile, source control AI) are left for follow-up PRs once the core shape looks right.Why
TuiAgentinstead of an unattached generic CLI type: Reusing the base agent preserves Orca's existing hooks, readiness detection, prompt injection, and resume logic without duplicating harness definitions or expanding the RPC/wire protocol.customTuiAgentslives in local desktop settings;launchableCustomAgentsskips non-local execution hosts (executionHostId !== LOCAL_EXECUTION_HOST_ID) so a local wrapper command is never sent across the wire or silently dropped by a remote host.Linked Issue
Fixes #9136
Visual Proof
Headless component-fixture screenshots were captured via
pnpm fixtures:shotfor empty, populated, and add-dialog states ofCustomTuiAgentsSection/CustomTuiAgentDialog(using Orca'sSettingsGroupcard layout andSettingsBadge/Button/Dialogprimitives) and verified with zero console or render errors. Before/after screenshots can be attached via GitHub UI if requested (CLI upload extension is not installed locally).Testing
Verified on macOS (arm64):
ORCA_CODE_QUALITY_BASE=upstream/main pnpm check:changed --base=upstream/main— all 42/42 checks passed (format, oxlint, changed-code quality, unit tests, all 4 typecheck projects, localization coverage/catalogs/extraction, dead design-system classes, import boundaries, React Compiler compat, and all ratchets).src/shared/agent-launch/catalog/custom-tui-agents.test.tscovers persistence normalization (trimming, newline collapse, deduplication, invalid-entry dropping) andresolveAgentStartupPlanInputs+buildAgentStartupPlanverifyinglaunchCommandreplacesagentCmdOverridesfor both launch and resume config.CustomTuiAgentsSection(empty, populated, add dialog) viapnpm fixtures:shotin headless Chromium.Performance
None, because custom-agent normalization only runs on settings load/save (bounded to 50 entries), and menu/search rows are computed only when the
+new-tab menu is opened.Risk
Level: Low
customTuiAgents?: CustomTuiAgent[]field inGlobalSettingsand optionallaunchCommand?: stringonLaunchAgentInNewTabArgs/resolveAgentStartupPlanInputs; zero behavior change when no custom agents are configured.git revertrestores prior behavior cleanly (any savedcustomTuiAgentskey in settings JSON is harmlessly ignored if reverted).AI Disclosure
Assisted by Antigravity (Gemini 4 Neon) and Claude Opus 5.5 for implementation, rebasing onto current
main, and verification.Review
Agent skill upstream boundary
Notes
normalizeCustomTuiAgentsstrips/collapses\r/\nto prevent multi-line shell injection, enforces length/count bounds (MAX_CUSTOM_TUI_AGENTS = 50), validatesagentviaisTuiAgent, and never forwards local commands to remote hosts.withLaunchCommandOverride/resolveAgentStartupPlanInputspipeline, which handles POSIX and Windows shells identically toagentCmdOverrides.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)