Repository navigation
feat(agent-launch): hiding an agent only hides it from pickers - #27766
brennanb2025 wants to merge 7 commits into
Conversation
The Settings switch that turns an agent off now only decides whether it shows in menus and pickers. An explicit launch of a hidden agent works from every path: - Host: removes the agent.launch planner, OpenCode session, resume, phone session terminal, worktree-create startup and orchestration launcher refusals, and the bare-command matcher's hidden skip. A linked draft starts the requested agent as is; only the default and detected picks skip hidden agents. - Typed commands match Settings command overrides before built-in commands, so a collision resolves to the agent the user named. - Status hooks follow only the status-hooks switch. Hiding an agent no longer removes its hooks or re-runs hook installation; hooks still go only to agents whose CLI is found on the machine. - Desktop window: dashboard spawn, saved AI-button / fix-checks agents, automation save, session continuation, the Source Control launch check, task-page direct launch and composer submit no longer refuse or drop an explicitly chosen hidden agent. The phone client's own pre-checks move to a follow-up PR.
…dialog - The Source Control action dialog and its auto-start check only whether the saved or selected agent is installed; the picker stays filtered. - Checks panel AI actions stay available when a saved agent is installed even if every detected agent is hidden. - Typed agent commands keep main's match order; only the hidden-agent skip is gone, so users who hide nothing see no change. - Leftovers: the offline CLI hook path, the OpenCode hook selector and the hook installer no longer carry per-agent hidden state.
… is selected Also drops the WSL guest install's now-pointless settings copy and the offline CLI test's leftover hidden-list expectation.
Hiding an agent only removes it from menus and pickers, so the Settings switch and the notices that mention it say shown/hidden instead of enabled/disabled, in every language.
…idden-not-refused
…ices The AI buttons, checks panel and Fix checks say no agent is both installed and shown, and offer installing or showing one; Quick Launch says all agents are hidden. Locale pins keep the new label and ja Shown stable under regeneration.
Status: ready for review (head eecf9da)Since bf61858. One review fix: each checks-panel AI button is now enabled only when its own saved agent, or a shown installed agent, can launch it (before, a saved hidden agent for one action kept all three enabled). New test covers it; CI green. Review. Three rounds with fresh reviewers each round, every finding fixed or listed:
Readiness. CI green on bf61858 (19 pass, 0 fail). Merged locally (no commit) with current main 93e0b80: no conflicts; localization extraction, catalogs and coverage, the Settings/locale tests and the renderer typecheck all pass. No file over the line limit, no line-limit disables, no new type assertions. Live QA (macOS hidden test copy with an isolated profile and real Claude/Codex; phone through the iOS simulator; settings changed only through the Settings UI):
During QA the real Not verified. The host-computer Settings > Agents screen (the test copy only had the local Mac); the phone's new-tab list with hidden agents (blocked as above). Follow-up listed in the body: a plain terminal now always attaches the |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to A saved hidden agent remains available for its own action without enabling unrelated actions. No actionable merge-blocking risk remains. Pre-merge checks |
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
7395f6b2-e0f6-40fb-a87e-b7978d09d89b
📒 Files selected for processing (111)
config/scripts/ci-shard-timings.jsonconfig/scripts/locale-ja-value-overrides.mjsconfig/scripts/locale-key-overrides.mjsconfig/scripts/locale-value-overrides.mjsconfig/scripts/vitest-sqlite-runtime-files.mjssrc/cli/handlers/agent-hooks.tssrc/cli/runtime-client-deferral.test.tssrc/cli/specs/orchestration-worker-specs.tssrc/main/agent-hooks/managed-agent-hook-controls.test.tssrc/main/agent-hooks/managed-agent-hook-controls.tssrc/main/agent-hooks/managed-agent-hook-startup.tssrc/main/agent-hooks/managed-hook-detection-commands.test.tssrc/main/agent-hooks/managed-hook-detection-commands.tssrc/main/agent-hooks/opencode-plugin-settings.tssrc/main/agent-hooks/wsl-hook-relay-guest-install.tssrc/main/agent-hooks/wsl-opencode-install-race.test.tssrc/main/agent-hooks/wsl-opencode-settings-lifetime.test.tssrc/main/agent-hooks/wsl-opencode-settings.test.tssrc/main/agent-launch/startup-agent-worktree-create.test.tssrc/main/claude-accounts/claude-launch-routing.test.tssrc/main/claude-accounts/claude-profile-router.test.tssrc/main/claude-accounts/claude-profile-router.tssrc/main/claude-accounts/claude-profile-wsl-router.test.tssrc/main/claude/claude-structured-launch-account-routing.test.tssrc/main/ipc/pty-ipc-spawn-drivers.tssrc/main/ipc/pty-spawn-env-terminal-basics.test.tssrc/main/ipc/pty/host-env/assembly.tssrc/main/ipc/pty/host-env/opencode-config.tssrc/main/ipc/pty/host-env/opencode-hook-installation.test.tssrc/main/ipc/pty/host-env/types.tssrc/main/ipc/pty/ipc/spawn-env-codex.tssrc/main/ipc/pty/provider/local-configure.tssrc/main/ipc/pty/runtime/spawn-preflight.tssrc/main/ipc/settings.test.tssrc/main/ipc/settings.tssrc/main/opencode/opencode-status-plugin-startup-refresh.test.tssrc/main/opencode/opencode-status-plugin-startup-refresh.tssrc/main/orcad/orcad-managed-agent-hooks.tssrc/main/persistence/profile-state/profile-state-offline-settings.test.tssrc/main/persistence/profile-state/profile-state-offline-settings.tssrc/main/runtime/managed-worktree-create-telemetry.test.tssrc/main/runtime/orca-runtime-create-agent-session.tssrc/main/runtime/orca-runtime-create-managed-worktree.tssrc/main/runtime/orca-runtime-get-agent-session-execution-namespace.tssrc/main/runtime/orca-runtime-get-terminal-interactive-wait.tssrc/main/runtime/orca-runtime-perform-mobile-session-pty-records-refresh.tssrc/main/runtime/orca-runtime-resolve-mobile-session-terminal-command.tssrc/main/runtime/orca-runtime-stop-requested-pty-ids.tssrc/main/runtime/orca-runtime-test-scenario-builders.spec.tssrc/main/runtime/orca-runtime-tests/mobile-session-tabs-part-08.spec.tssrc/main/runtime/orca-runtime-tests/mobile-session-tabs-part-12.spec.tssrc/main/runtime/orca-runtime-tests/paired-settings.spec.tssrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-02.spec.tssrc/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-03.spec.tssrc/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-03.spec.tssrc/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-04.spec.tssrc/main/runtime/rpc/methods/agent-hooks.test.tssrc/main/runtime/rpc/methods/agent-hooks.tssrc/main/runtime/rpc/methods/orchestration/worker/worker-start-validation.tssrc/main/runtime/runtime-agent-launch-resolution.tssrc/main/runtime/runtime-agent-terminal-startup.tssrc/main/runtime/runtime-client-agent-launch-settings-durability.test.tssrc/main/runtime/runtime-client-settings.tssrc/main/runtime/runtime-worktree-agent-startup.test.tssrc/main/runtime/runtime-worktree-agent-startup.tssrc/main/startup/codex-hook-startup-wiring.test.tssrc/main/startup/codex-launch-hook-switch.test.tssrc/main/startup/codex-launch-preparation.tssrc/main/startup/codex-session-resume-daemon-guard.test.tssrc/main/startup/codex-session-resume-launch.tssrc/main/startup/main-process-pty-startup.tssrc/main/startup/main-process-ready-runtime.tssrc/renderer/src/components/agent-session-continuation/AgentSessionContinuationDialog.tsxsrc/renderer/src/components/automations/automation-save-action.tssrc/renderer/src/components/dashboard/launch-dashboard-agent.tssrc/renderer/src/components/right-sidebar/SourceControlAgentActionDialog.test.tsxsrc/renderer/src/components/right-sidebar/SourceControlAgentActionDialogForm.tsxsrc/renderer/src/components/right-sidebar/buildSourceControlAgentDeliveryPlan.tssrc/renderer/src/components/right-sidebar/checks-panel/use-checks-panel-comment-resolution.tsxsrc/renderer/src/components/right-sidebar/source-control-agent-action-dialog-support.tssrc/renderer/src/components/right-sidebar/source-control/ai/recovery-launch.tssrc/renderer/src/components/right-sidebar/useSavedSourceControlAgentActionAutoStart.tssrc/renderer/src/components/right-sidebar/useSourceControlAgentActionDialog.tssrc/renderer/src/components/settings/AgentCatalogRow.tsxsrc/renderer/src/components/settings/AgentsPane.test.tsxsrc/renderer/src/components/tab-bar/QuickLaunchButton.tsxsrc/renderer/src/hooks/composer-state/composer-name-ownership.test.tssrc/renderer/src/hooks/composer-state/composer-submit-orchestration.tssrc/renderer/src/hooks/composer-state/folder-submit-orchestration.tssrc/renderer/src/hooks/composer-state/quick-submit-source-preparation.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/fr.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/renderer/src/lib/fix-checks-agent-launch.tssrc/renderer/src/lib/launch-agent-session-continuation.tssrc/renderer/src/lib/launch-work-item-direct-agent-routing.tssrc/renderer/src/lib/launch-work-item-direct.test.tssrc/renderer/src/lib/source-control-agent-action-launch-check.test.tssrc/renderer/src/lib/source-control-agent-action-launch-check.tssrc/shared/agent-status-hooks-setting.tssrc/shared/opencode-launch-command.test.tssrc/shared/opencode-launch-command.tssrc/shared/orchestration-dispatch-refusal-contract.tssrc/shared/source-control-launch-agent-selection.test.tssrc/shared/source-control-launch-agent-selection.tssrc/shared/tui-agent-selection.test.tssrc/shared/tui-agent-selection.tstests/e2e/host-agent-launch-settings-hook-bookkeeping.unit.test.ts
💤 Files with no reviewable changes (25)
- src/main/ipc/pty/ipc/spawn-env-codex.ts
- src/renderer/src/hooks/composer-state/composer-submit-orchestration.ts
- src/renderer/src/lib/source-control-agent-action-launch-check.test.ts
- src/main/opencode/opencode-status-plugin-startup-refresh.test.ts
- src/main/runtime/orca-runtime-tests/terminal-creation-and-readiness-part-02.spec.ts
- src/shared/tui-agent-selection.ts
- src/renderer/src/lib/launch-work-item-direct.test.ts
- tests/e2e/host-agent-launch-settings-hook-bookkeeping.unit.test.ts
- src/renderer/src/hooks/composer-state/composer-name-ownership.test.ts
- src/main/ipc/pty/provider/local-configure.ts
- config/scripts/vitest-sqlite-runtime-files.mjs
- src/main/runtime/orca-runtime-tests/mobile-session-tabs-part-12.spec.ts
- config/scripts/locale-ja-value-overrides.mjs
- src/main/ipc/pty/runtime/spawn-preflight.ts
- src/renderer/src/components/right-sidebar/buildSourceControlAgentDeliveryPlan.ts
- src/main/ipc/pty/host-env/types.ts
- src/main/runtime/orca-runtime-resolve-mobile-session-terminal-command.ts
- src/main/runtime/orca-runtime-tests/worktree-setup-and-startup-part-03.spec.ts
- src/renderer/src/lib/source-control-agent-action-launch-check.ts
- src/main/runtime/orca-runtime-get-agent-session-execution-namespace.ts
- src/main/ipc/pty-ipc-spawn-drivers.ts
- src/main/runtime/runtime-agent-terminal-startup.ts
- src/main/runtime/orca-runtime-create-agent-session.ts
- src/renderer/src/lib/launch-agent-session-continuation.ts
- src/shared/agent-status-hooks-setting.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
A saved hidden agent for Fix checks no longer enables Resolve conflicts and Resolve comments, whose launches have no agent to start.
|
Closing: disabled agents should be refused at launch, because Orca stops maintaining their status hooks (Brennan, 10-12). Main's refusals stay. |
ELI5
Hiding an agent in Settings (the switch used to say Disabled) did more than hide it from menus. Orca also refused to start it when you asked for it by name, from the phone, the CLI, orchestration workers, workspace creation, resume, chat sessions and the Source Control AI buttons. Each path had its own "agent is disabled" error, and some quietly swapped in a different agent. Hiding also removed the agent's status hooks, and a typed command like
claudestopped being treated as that agent.After this change the switch only decides whether an agent shows in menus and pickers. As Brennan put it: "the disabled button is just for showing it in the UI or not". An agent you've hidden still starts when something asks for it by name, and it behaves like any other agent.
What Changed
Every row assumes the agent is hidden in Settings.
Host (anything that asks an Orca host to start an agent: phone, CLI, workers, the desktop window)
worker-start --agent X)orca worktree create --agent X)claude(for exampleorca terminal create --command claude)Desktop window
Also removed, as cleanup: the same check in dashboard "start agent", "Continue in ", saving a new automation, and the new-workspace composer. Their pickers already listed only visible agents, so users couldn't reach those refusals. Nothing changes for users there.
Settings > Agents: each agent's switch now reads Shown / Hidden instead of Enabled / Disabled (its screen-reader label is " visibility"), and a hidden agent's badge says "Hidden". Notices that said "No enabled agents" now talk about installed and shown agents instead of enabled ones, and name the next step. For example, the Quick Launch menu says "All agents are hidden. Show one in Settings." The AI buttons and checks panel say "No AI agent is both installed and shown in Settings. Install one, or show one in Settings." The CLI
worker-start --agenthelp no longer says the agent must be "enabled". Every language is updated.Mobile app: the phone's own menus and pre-checks still block hidden agents until the mobile follow-up PR: the new-tab list, task-page workspace create, new-workspace submit and AI actions. That follow-up also shows an older host's refusal in plain words. Until then, the phone benefits from this PR only on the waiting-tab row above.
Status hooks
Still the same: hidden agents stay out of menus, pickers, shortcut lists and the automatic agent pick, meaning the default-agent choice and the agent Orca picks from the CLIs it detects. Typed commands still match in the same order as before; the only difference is that a hidden agent's command is no longer skipped. Users who hide nothing see no change.
Mechanism
runtime-agent-terminal-startup.ts), chat-session create, resume, the phone's session-terminal command, workspace-create startup (runtime-worktree-agent-startup.ts,orca-runtime-create-managed-worktree.ts) and the orchestration launcher check. Also removed the hidden-agent skip from the step that recognises a typed agent command (resolveBareAgentLaunchCommand).resolveWorktreeStartupDraftAgent). Only the default and the detected pick still skip hidden agents.isAgentStatusHooksEnabledForAgent. Every hook gate now reads only the status-hooks switch: managed hook install and removal, hook detection, Pi/OMP/prime-agent extensions, Codex launch preflight, the OpenCode plugin locally and in WSL, Claude account hook setup, and the offline CLIorca agent hooks on/off. Changing which agents are hidden no longer re-runs hook installation.isSourceControlAgentDetected); its picker stays filtered.pickSourceControlLaunchAgentkeeps a saved agent that is installed even if it is hidden. The phone's only caller still rejects a hidden saved agent before reaching it, so the phone's behaviour doesn't change. Orphaned strings and their translations are deleted.Merging main brought in #26479, whose new host settings path re-ran status-hook installation when the hidden-agent list changed. That re-run is removed here, because hiding no longer changes hooks.
This was split out of #27692 (launch convergence). The two PRs overlap on one spot, the 3-line refusal in
runtime-agent-terminal-startup.ts. Whichever merges second rebases that line.Why
Brennan's decision: the Settings switch is a display preference. A refusal at launch time turned a menu preference into a lock. Every caller had to re-check it, and they disagreed: some refused, some silently swapped in another agent, some fell back to a plain shell, and some did nothing. Removing the refusals, instead of adding a "launch anyway" path, means hiding has one meaning everywhere.
Linked Issue
Split out of #27692.
Visual Proof
Live QA on the final head (bf61858), in a hidden test copy of Orca with an isolated profile and real Claude/Codex.
Settings > Agents: each agent has a Shown / Hidden switch; a hidden agent gets a "Hidden" badge.
With every detected agent hidden, the "+" menu names the next step instead of listing agents:
A hidden agent still starts when asked for by name. Here the phone (iOS simulator, paired to the test copy) opens a workspace whose only tab was a slept, hidden Claude tab: Claude starts in that tab (its own folder-trust screen), not a plain shell.
Testing
tc-gate pnpm tc:node,tc:web,tc:cli: pass.orca-ci-checks --no-typecheck: 24 of 25 pass. The remaining one,typecheck:ci, could not run locally: its bun runner failed withScript not found "check"before type checking. The three typechecks above cover the same projects.Tests that pinned the removed refusals or the hidden-agent hook opt-out were deleted. Tests that used the hidden list only as a switch for "plugin off" now use the status-hooks switch. Guards added (each goes red if the change is reverted):
Host: an explicitly requested hidden agent starts, both as a startup agent and as a typed command that gets its Settings arguments. Checked by putting each removed check back.
A chosen hidden agent for a workspace created from an issue or PR with a starting prompt is used without detection.
A hidden agent whose CLI is present still gets its hooks installed.
Desktop: a Source Control action whose saved agent is hidden auto-starts. Checked by putting the old check back. Plus
pickSourceControlLaunchAgentkeeps a hidden saved agent that is installed.The phone's plain-shell fallback when a launch can't be built.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Review
Agent skill upstream boundary
Notes
agent_disabledhook skip reason stays in the shared type because older hosts can still report it.Checklist
N/Awith reason (after shots from live QA above; the before state is the old Enabled / Disabled switch)pnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)