Repository navigation
fix(native-chat): ignore the terminal launch command when starting a native chat - #25720
Conversation
…native chat A custom launch command in settings made structured native chat unavailable: the renderer route, the host launch-mode decision, and the host's create-support all treated it as terminal-only, so a user with the chat default on silently got a terminal. The command names the CLI binary and now applies to terminal launches only; native chat ignores it. A start directory outside the workspace still forces a terminal. The internal route field and blocker are renamed to that concept; the wire reason `tui_launch_command` is kept and its receipt text now names the start directory.
…ores-cli-launch-command
…ores-cli-launch-command
…ores-cli-launch-command
Review and QA summaryThe problem. If you set a custom launch command for Claude or Codex in Settings > Agents, Orca stopped giving you native chat for that agent, even with native chat as your default. New tabs, orchestration workers and "Resume in chat" all fell back to a terminal running your command. The launch command is meant only for terminal launches, so this PR makes native chat ignore it. What changes for you. With native chat as your default and a custom command set, a new Claude/Codex tab now opens as native chat. Terminal launches still run your command. Native chat runs the stock Review.
Mixed versions. No message shapes change.
Verified.
Not verified.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (20)
💤 Files with no reviewable changes (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review. 📝 WalkthroughWalkthroughStructured-chat routing now uses whether the requested working directory is outside the workspace root as a blocker. Configured terminal launch commands no longer force structured sessions into terminal mode or prevent structured session creation. Terminal launches still use configured commands. Updated tests cover routing, receipts, and terminal launch configuration. Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to No actionable merge-blocking issue was established; the change is ready to merge after normal checks. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to Native chat can now start despite a custom terminal launch command. The inspected account and permission checks remain independently enforced, but protections supplied by custom wrappers are not inherited. Recovery coverage remains incomplete. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
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. Comment |
- Takes main's deletion (#25791) of the host startup call-site inventory, its attribution test and daemon-protocol-version.test.ts; v42 stays pinned by daemon-foreground-confirmation-protocol and the build-contract test, and launch files by daemon-launch-file-protocol. - #25720's custom-launch-command test plans its prompted launch with this branch's planner, which keeps the custom command on the line.
Main squash-merged D1 #24990 (from 320f347) and C1a #25141 (383b0dc). Conflicts: - #25720 dropped the launch-command override gate from native-chat create support and renamed the route input to startsOutsideWorkspaceRoot: main's version, with D3's agent-generic typing and host structured-agents input. - the model catalog store's refresh: D3's agent: string plus main's new lister parameter. - #25654's tool-run header restyle lands in C5's NativeChatToolRunCallCounts, which holds that span.
ELI5
In Settings > Agents you can replace the command Orca types to start an agent in a terminal (for example
claude→/opt/tools/claude-wrapper). Until now, setting that command quietly turned off native chat for that agent: even with native chat as your default, new Claude or Codex tabs opened as terminals. That command is only for the terminal version of the agent, so native chat now ignores it. You get native chat as your default says, and your terminal launches still run your command.What Changed
The problem. Orca's native chat talks to Claude and Codex directly (Claude through its SDK, Codex through
codex app-server); it never types a command into a shell. When a user had set a custom launch command for an agent, Orca assumed native chat would skip their wrapper, so it routed that agent away from native chat in four places:The product decision is that the launch command applies only to terminal launches. Native chat should ignore it.
Before: native chat is your default and you set a custom command for Claude. Every new Claude tab opens as a terminal running your command, and you can't get a native chat for Claude at all.
After: new Claude tabs open as native chat. Choosing a terminal launch still runs your custom command, exactly as before.
Mechanism.
agent-launch-route-input.ts), the host's launch-mode decision used by orchestration, the CLI and mobile (agent-launch-mode.ts), and the host's create-support answer (structured-agent-session-create-support.ts) no longer readagentCmdOverrides. All three change together: if only the renderer changed, a local launch would choose chat and the host would refuse it.requiresTuiLaunchCommandtostartsOutsideWorkspaceRoot(blockercustom-start-directory) so it no longer reads as "the launch command decides this". Neither name is persisted or sent between apps.tui_launch_commandthat orchestration, CLI and mobile receipts carry keeps its wire value (older clients and hosts know it). Only its text changed to describe the start folder, its sole remaining cause.Why
The custom command was blocking native chat because native chat would "silently skip the wrapper". With the decision that the command is a terminal-only setting, skipping it in native chat is the intended behaviour, not a bug to route around. Removing the check at its source is cleaner than adding a second "but not for chat" guard next to it.
What the user should know:
PATHor in its known install folders; Codex on thePATHof your login shell (plus Codex's Environment overrides). A wrapper you put in the Command field (a nightly build, a secrets loader, flags baked into the command) does not apply to native chat. The Environment field still does.CLAUDE_CONFIG_DIRbefore running Claude) also don't apply to native chat. Put that variable in the agent's Environment field instead, which native chat does read.Mixed versions (desktop, paired host and phone update separately). No message shapes change; only which answer a host gives.
Linked Issue
N/A (maintainer change from a product decision; no issue).
Visual Proof
Setup for both: native chat is the default for new agent tabs, and Codex's Command is set to a stand-in script that prints
CUSTOM-LAUNCH-COMMAND-RAN. A fake Codex sits onPATHfor native chat."Show terminal":
Settings row with the custom command:

After resetting the command, a new tab is still a native chat:
Testing
New tests, each for Claude and Codex with a custom command and native chat as the default: renderer route and feasibility choose chat; host create-support says supported; orchestration worker start chooses structured; the launch executor opens a structured session and no terminal. A terminal startup plan still runs the custom command.
Updated tests that pinned the old behaviour (route input, create-support, worker-start mode and receipt wording, routing authority).
Targeted vitest runs, oxlint, typecheck (web, node, cli).
Manual QA on macOS (a separate Mac, isolated dev Orca builds of main and this branch, fake Codex, custom command set to a stand-in script):
I manually tested these changes locally
Automated tests added/updated, or explained why not below
AI Disclosure
Review
Agent skill upstream boundary
docs/reference/agent-skill-sharing-upstream-boundary.mdand copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.Notes
Ensure no issues in: Security, Cross-platoform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)