Skip to content

fix(native-chat): ignore the terminal launch command when starting a native chat - #25720

Merged
brennanb2025 merged 4 commits into
mainfrom
brennanb2025/chat-ignores-cli-launch-command
Oct 6, 2026
Merged

brennanb2025 merged 4 commits into
mainfrom
brennanb2025/chat-ignores-cli-launch-command

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 10 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​106 $\color{#cf222e}{\Huge{\mathbf{−}}}$​80 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​26
Prod 10 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​41 $\color{#cf222e}{\Huge{\mathbf{−}}}$​75 $\color{#cf222e}{\Huge{\mathbf{−}}}$​34

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:

  • a new agent tab opened as a terminal instead of a chat;
  • background workers started by orchestration fell back to a terminal;
  • the machine running the agent answered "can't create a chat here" for that agent, so other clients (a paired desktop, the phone app) also got a terminal;
  • "Resume in chat" was hidden for that agent's past sessions, because it uses the same check.

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.

  • The renderer's route input (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 read agentCmdOverrides. All three change together: if only the renderer changed, a local launch would choose chat and the host would refuse it.
  • The one remaining "terminal only" input to that route is a requested start folder outside the workspace (a native chat always runs in its workspace). That rule is unchanged. Its internal name changed from requiresTuiLaunchCommand to startsOutsideWorkspaceRoot (blocker custom-start-directory) so it no longer reads as "the launch command decides this". Neither name is persisted or sent between apps.
  • The receipt reason tui_launch_command that 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.
  • Unchanged on purpose: the terminal-backed chat's model picker still reads the custom command (that chat runs your CLI in a terminal, so it should list your binary's models, not the stock one's).

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:

  • Native chat runs the stock agent. Claude is found on PATH or in its known install folders; Codex on the PATH of 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.
  • Wrappers that point the agent at a different config folder (for example one that sets CLAUDE_CONFIG_DIR before running Claude) also don't apply to native chat. Put that variable in the agent's Environment field instead, which native chat does read.
  • "Not on PATH" is mostly unreachable. Settings only shows a Command field for agents Orca detected, so the stock binary is normally findable. If someone kept an override after removing the stock install, the native chat opens and shows the existing "couldn't start" error.
  • No new warning. We don't add a notice that the command was ignored in native chat. The setting is described as a launch command and nothing claims it affects chat.

Mixed versions (desktop, paired host and phone update separately). No message shapes change; only which answer a host gives.

  • New desktop + older paired host with an override: the older host still declines, and the desktop falls back to a terminal on that host, as today.
  • Older desktop or phone + newer host: the host now says yes, so they open a chat there. This is the intended result.

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 on PATH for native chat.

Before (main) After (this PR)
New Codex tab Looks like a chat, but it's a terminal running the custom command:

"Show terminal":
A real native chat; the custom command does not run:
Terminal launch Runs the custom command:
Still runs the custom command:

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):

    • New Codex tab: before, a terminal running the command; after, a native chat that answers, and the command never runs.
    • Terminal launch: both builds run the command.
    • After resetting the command: still a native chat.
    • Opening a workspace: before, its auto-started agent ran the command in a terminal; after, it opens a native chat.
    • Not exercised in the app: orchestration/CLI launches (covered by unit tests), paired-host and phone combinations (reasoned from code; no message shapes change), Windows/Linux.
  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

AI Disclosure

Review

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and 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

  • SSH: unchanged. SSH workspaces never get native chat; this check never applied there.
  • Mobile: no mobile code change. The phone follows the host's answer, which now admits these agents.
  • Windows/WSL: unchanged rules; the removed check was platform-independent.

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)
  • 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)

…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.
@brennanb2025
brennanb2025 marked this pull request as ready for review October 6, 2026 04:02
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Review and QA summary

The 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 claude/codex found on your PATH (or Claude's known install folders), so a wrapper in the Command field does not apply there; the Environment field still does.

Review.

  • Round 1 used two adversarial reviewers (the core routing sites; every other reader of the setting, plus mixed versions and mobile) and an architecture challenger that designed its own fix first. The design matched, with one correction adopted: the terminal-backed chat's model picker keeps reading the custom command, because that chat really runs your CLI.
  • Fixed: three stale or misleading comments (P3).
  • The readiness review (SSH, crashes and retries, security, performance, correctness, backward compatibility, cross-platform, code organization) passed with no P0, P1 or P2 findings.
  • Deferred, all present on main before this PR:
    • The Source Control agent dialog briefly previews "Launch: " before a native chat starts.
    • The "+" Codex item's tooltip says "Launch Codex in a new terminal" even when it opens a chat.
    • An orchestration agent alias named after a custom command gets a terminal only incidentally.

Mixed versions. No message shapes change.

  • A new desktop paired with an older host that has a custom command: the host still declines, and you get today's terminal on that host.
  • An older desktop or phone talking to a newer host: it now gets a native chat.

Verified.

  • Unit tests: 408 across 20 files, including new Claude and Codex cases for the renderer route, host create-support, orchestration worker start and the launch executor. A terminal startup plan still runs the custom command.
  • Local lint and typecheck (web, node, cli): only errors already present on main. CI is green on the final head, including the cross-version wire suite.
  • Manual QA on a separate Mac with isolated dev builds of main and this branch, a fake Codex, and a stand-in custom command:
    • before: new Codex tab = terminal running the command;
    • after: native chat that answers, and the command never runs;
    • terminal launch runs the command in both builds;
    • after resetting the command: still native chat.
      Screenshots are in the PR body.

Not verified.

  • Orchestration/CLI and paired-host or phone flows in the running app (unit tests and code reading only).
  • Windows and Linux in the app.

@coderabbitai

coderabbitai Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 19e35c34-bc5a-46d4-bb4a-b500a27d1a30
📥 Commits

Reviewing files that changed from the base of the PR and between 1b52be6 and 676cb7b.

📒 Files selected for processing (20)
  • src/main/agent-launch/agent-launch-executor.test.ts
  • src/main/agent-launch/agent-launch-executor.ts
  • src/main/agent-launch/agent-launch-mode.ts
  • src/main/native-chat/structured-agent-session-create-support.test.ts
  • src/main/native-chat/structured-agent-session-create-support.ts
  • src/main/runtime/rpc/methods/orchestration-worker-start-mode.test.ts
  • src/main/runtime/rpc/methods/orchestration-worker-start-receipt-wording.test.ts
  • src/renderer/src/lib/agent-launch-route-input.test.ts
  • src/renderer/src/lib/agent-launch-route-input.ts
  • src/renderer/src/lib/agent-launch-routing.test.ts
  • src/renderer/src/lib/agent-launch-routing.ts
  • src/renderer/src/lib/agent-session-launch-plan.ts
  • src/renderer/src/lib/tui-agent-startup.test.ts
  • src/shared/agent-launch-intent.ts
  • src/shared/agent-launch-operation.ts
  • src/shared/structured-native-chat-launch-route.test.ts
  • src/shared/structured-native-chat-launch-route.ts
  • src/shared/tui-agent-launch-command-override.test.ts
  • src/shared/tui-agent-launch-command-override.ts
  • tests/e2e/structured-native-chat-routing-authority.unit.test.ts
💤 Files with no reviewable changes (2)
  • src/renderer/src/lib/agent-session-launch-plan.ts
  • src/main/runtime/rpc/methods/orchestration-worker-start-receipt-wording.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Structured-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 676cb

No actionable merge-blocking issue was established; the change is ready to merge after normal checks.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 676cb

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
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The affected cohort is otherwise eligible Claude and Codex launches with terminal command customization. They now enter native execution on the selected runtime, using provider-resolved workspace and account state instead of executing the terminal wrapper.

Trust Boundaries and Controls

  • observed — Native permission posture is resolved independently of free-form terminal commands. Claude translates its permission mode into owned launch options. Codex’s policy helper explicitly distinguishes approval-enabled workspace-write execution from bypass execution with danger-full-access; native execution is therefore not inherently sandboxed.
  • observed — Claude resolves authentication separately from the terminal wrapper, waits for account switching to settle, and rejects explicit authentication-environment conflicts when a managed account owns the credential.

Resilience and Maintainability Implications

  • observed — Unknown post-attachment outcomes do not trigger a second terminal launch. A workspace already created can remain when the outcome is unknown; this behavior predates the PR. Later cleanup or reconciliation was not established, so retention is not treated as a newly introduced security concern.

Hardening Proposals

  • proposed — Make the terminal-only command contract explicit where users configure wrappers, including that wrapper-supplied sandbox, credential, and network restrictions do not transfer to native chat. Direct users to native permission and account controls without promising policy equivalence.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: custom terminal launch commands no longer prevent native chat from starting.
Description check ✅ Passed The description explains the user impact, implementation, rationale, compatibility considerations, visual proof, and testing. It marks the linked issue as not applicable for a maintainer change, as th…
Docstring Coverage ✅ Passed Docstring coverage is 83.33% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 18 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autopilot · 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@brennanb2025
brennanb2025 merged commit 8d2e926 into main Oct 6, 2026
56 checks passed
brennanb2025 added a commit that referenced this pull request Oct 6, 2026
- 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.
brennanb2025 added a commit that referenced this pull request Oct 6, 2026
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.
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.

1 participant