Skip to content

Fix extra terminal during background native-chat setup - #29810

Merged
AmethystLiang merged 1 commit into
mainfrom
fix-native-chat-setup-primary
Oct 16, 2026
Merged

AmethystLiang merged 1 commit into
mainfrom
fix-native-chat-setup-primary

Conversation

@AmethystLiang

@AmethystLiang AmethystLiang commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​168 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​168
Prod 4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​103 $\color{#cf222e}{\Huge{\mathbf{−}}}$​3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​100

ELI5

Creating a native-chat workspace on a connected host with automated setup no longer adds an unwanted plain terminal beside Setup.

What Changed

The host already leaves the first surface to the caller for background agent creates without setup. Setup provisioning now uses that same rule. Activated requests still receive a primary terminal, and both setup split modes retain the shell they need as an anchor.

Regression tests follow the production renderer payload through RPC validation and host creation, and check the actual terminal commands created. They cover Claude, Codex, blank selection, activation, run-hooks, defaults, startup, and both split directions.

Why

The two host branches disagreed about the same existing request. Reusing their background policy fixes older clients too, without adding a wire field or changing setup modes. This is PR 1; removing setup split modes remains a separate change.

Linked Issue

No linked issue; internal maintainer fix.

Visual Proof

The same isolated paired desktop request with an agent selected and no terminal startup, captured through Playwright CDP. Original host: plain terminal + Setup (2 tabs). Fixed host: Setup alone (1 tab). Both runs asserted every native window stayed hidden and unfocused. The probe verifies provisioning and the rendered terminal strip; it does not launch a structured agent session.

Before After
Before: extra plain terminal After: Setup alone

Testing

  • Tested the real paired-app behavior locally through hidden Playwright/CDP
  • Automated regression coverage added
  • Background test runs: 1,451 passed, one existing skip across seven relevant suites; 15 additional focused controls and four first-surface tests passed.
  • Node and web typechecks passed; changed-file code quality, formatting and Electron e2e build passed. Hidden paired-app before/after probe passed on both builds.
  • Before-fix regression: both agents produced a plain shell followed by Setup; nine controls passed.
  • macOS ARM64 only locally. Windows, Linux, WSL and SSH execution were not manually exercised; existing runner/transport behavior is unchanged and CI remains required.

Review

Independent Codex gpt-6-astra high design and final code review found no unresolved P0/P1. Design and review notes are in docs/native-chat-setup-provisioning-design.md and docs/native-chat-setup-provisioning-review.md.

Agent skill upstream boundary

  • Not applicable; no upstream skill-installer content copied.

Notes

No RPC shape, process command, execution-host ownership, setup sequencing, UI style, or focus-policy change. Existing conditional issue-only delivery and asynchronous setup failure reporting remain outside this fix.

Checklist

  • Small and focused
  • User-visible behavior, mechanism and alternatives explained
  • Before/after captures attached
  • Self-reviewed for correctness, security and performance
  • Cross-platform, folder and SSH/remote impact considered
  • Relevant tests, node/web typechecks and changed-file lint passed; full required CI must pass before merge

@coderabbitai

coderabbitai Bot commented Oct 16, 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: 2c5bed21-fc3f-40a4-ab3f-d03e91b8936b
📥 Commits

Reviewing files that changed from the base of the PR and between 79b9163 and 7be9dbe.

📒 Files selected for processing: 8
  • config/tsconfig.node.json
  • docs/native-chat-setup-provisioning-design.md
  • docs/native-chat-setup-provisioning-review.md
  • src/main/runtime/orca-runtime-tests/worktree-native-chat-setup.spec.ts
  • src/main/runtime/orca-runtime.test.ts
  • src/main/runtime/runtime-local-worktree-terminal-startup.test.ts
  • src/main/runtime/runtime-local-worktree-terminal-startup.ts
  • src/renderer/src/lib/worktree-creation-chat-setup.test.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.

📝 Walkthrough

The runtime now uses a shared predicate to decide whether caller-provided agent chat supplies the initial terminal surface. Promised agent chat always counts; agent attribution counts only when activation and hooks are both disabled. The change adds regression tests for worktree payloads and setup provisioning, and adds design and review documents. The Node TypeScript configuration also includes the worktree creation payload file.

Priority: ⬇️ Low

Severity of issue fixed: Low

Merge Risk: ⚪ Minimal · up to 7be9d

No actionable issue remains in the supplied evidence; merge after the required CI checks pass.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 5 files. (3 skipped: 3 … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely identifies the fix for the extra terminal created during background native-chat setup.
Description check Passed The description covers the required sections, explains the user-visible change and rationale, provides before-and-after visual proof, and reports testing and platform limits. The maintainer exemption …
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.
Full details: Description check

Explanation

The description covers the required sections, explains the user-visible change and rationale, provides before-and-after visual proof, and reports testing and platform limits. The maintainer exemption explains the lack of a linked issue.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 5 files. (3 skipped: 3 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • 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.

❤️ Share

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

@AmethystLiang
AmethystLiang merged commit 7f9b51c into main Oct 16, 2026
31 checks passed
brennanb2025 added a commit that referenced this pull request Oct 16, 2026
Main now always runs Setup in its own tab (#29819) and lets background
agent creates leave the first surface to the caller (#29810). Keep both:
the creation owner still suppresses the starter shell, and background
attribution-only creates follow main's narrower rule. With no split Setup
mode left, owned navigation queues Setup directly and the "Setup could
not run" fallback is gone.
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