Skip to content

fix(native-chat): stop seeding a stray terminal beside a chat create - #19123

Merged
brennanb2025 merged 3 commits into
mainfrom
brennanb2025/no-stray-terminal-on-native-chat-create
Sep 6, 2026
Merged

brennanb2025 merged 3 commits into
mainfrom
brennanb2025/no-stray-terminal-on-native-chat-create

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​288 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​288
Prod 6 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​47 $\color{#cf222e}{\Huge{\mathbf{−}}}$​4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​43

ELI5

Creating a workspace that opens a Claude/Codex native chat also dropped an empty Terminal 1 next to it. The chat already is your starting surface — the shell was pure noise. Now you get the chat (plus the background Setup tab, when your repo has a setup script).

What Changed

activateAndRevealWorktree accepts providesInitialSurface: true, which means "I open my own primary surface, don't seed a shell for me". That opt-out was only honoured when there was no other activation work (worktree-activation.ts).

A worktree create in a repo with a setup script returns setup, which counts as activation work — so the opt-out was skipped, ensureWorktreeHasInitialTerminal ran, and it created a bare terminal purely to serve as the "primary tab" before handing setup its own tab. Result: Terminal 1 + Setup + Claude Chat.

That bare terminal was never needed for a new-tab setup. queueSetupAndIssueCommands only uses the primary tab in that mode to restore focus to it after the Setup tab auto-activates.

  • worktree-activation.ts — forwards providesInitialSurface into seeding as callerProvidesSurface.
  • worktree-initial-terminal-seeding.ts — when the caller owns the surface and the workspace has no tab yet, skip the shell and let setup open its own tab.
  • worktree-setup-issue-command-queue.ts — terminalTabId is now nullable; with no host tab, setup still gets its tab and the focus-restore/split paths are skipped.

A terminal is still seeded whenever the launch work genuinely needs one to attach to:

Launch work Seeds a shell?
New-tab setup script only No — setup gets its own tab
Split-mode setup script (split-vertical / split-horizontal) Yes — a split needs a pane
Issue automation (always splits) Yes
Startup command / createNewTerminalForStartup Yes
Configured defaultTabs Yes — via the existing default-tab path
Caller does not own the surface Yes — unchanged

One seam covers all three create routes (full composer, quick create, work-item launch), since they all activate through activateAndRevealWorktree.

Why

Direct user report: "When I start a claude native chat via worktree create it spawns a terminal AND a claude chat. It should JUST spawn the claude/codex native chat."

Fixing it at the activation seam rather than in each create route matches how the folder-workspace path already behaves — ensureFolderWorkspaceInitialTerminal returns null for providesInitialSurface today, so this makes the git-worktree path honour the same contract instead of diverging on the presence of a setup script.

The structured-launch refusal fallback is unaffected: it re-activates with createNewTerminalForStartup: true and gets a real terminal. It actually gets cleaner — that path previously produced three tabs (stray shell + Setup + fallback agent terminal) and now produces two.

Linked Issue

No tracking issue — came in as a direct report with a screenshot. Happy to file one if preferred.

Visual Proof

Before (reported):

Terminal 1 (focused, empty shell) | Setup | Claude Chat

After: Setup | Claude Chat, with the chat focused.

Attaching a recorded before/after next — flagging that the screenshots are not yet on this PR rather than letting the section imply they are.

Testing

New suite src/renderer/src/lib/worktree-activation-structured-chat-surface.test.ts (5 tests):

  • new-tab setup + caller-owned surface → one tab, titled Setup, primaryTabId is null
  • split-mode setup → still seeds the shell, still splits
  • issue automation → still seeds the shell, still splits
  • no caller-owned surface → unchanged two-tab behaviour
  • end-to-end through activateAndRevealWorktree, proving providesInitialSurface is actually forwarded

Red/green ablation: with the guard removed, the two behaviour tests fail (expected '<uuid>' to be null) and the three "still seeds a shell" guards pass either way — so the suite is pinned to the mechanism, not just to a passing state.

Also run:

  • 10 activation/creation suites — 117 tests, all pass
  • pnpm tc — clean
  • pnpm run check:code-quality:changed — 0 findings across 5 files (code quality, type-aware, React Doctor)

Renderer-only tab-seeding logic, no platform-specific paths, so macOS/Linux/Windows/SSH behave identically. Not yet exercised in a running app — see Visual Proof.

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below

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

  • Security: none — no new IPC, RPC, or process spawn.
  • Cross-platform: renderer tab bookkeeping only; the setup-runner command building it feeds is untouched.
  • Remote SSH: the runtime-owned/hostAuthority === 'live' branch returns before the new guard, so host-owned terminal creation is unchanged.
  • Mobile: untouched — mobile session tabs project from the runtime, not this seam.
  • Backwards compatibility: callerProvidesSurface is optional and only set by activation when the caller already opted out; every existing caller keeps today's behaviour.
  • Performance: one fewer tab and one fewer PTY spawn per native-chat create.

Checklist

  • This PR is small and focused
  • I explained what changed and why (including ELI5)
  • 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)

A native-chat worktree create activates with `providesInitialSurface: true`,
meaning "I open my own primary surface, don't seed a shell". Activation only
honoured that when there was no other activation work, so any repo returning a
setup script fell through to `ensureWorktreeHasInitialTerminal`, which created a
bare terminal purely to act as the primary tab before giving setup its own tab.
The user landed on `Terminal 1` + `Setup` + `Claude Chat`.

The bare terminal was never needed for a new-tab setup: `queueSetupAndIssueCommands`
only uses the primary tab there to restore focus to it.

Forward `providesInitialSurface` into seeding as `callerProvidesSurface`, and skip
the shell when the launch work needs no host tab. A terminal is still seeded when
something has to attach to it: a startup command, issue automation, a split-mode
setup script, `createNewTerminalForStartup`, or configured default tabs.
@coderabbitai

coderabbitai Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The change adds callerProvidesSurface to initial terminal options. Worktree activation passes this flag to terminal seeding. Eligible empty worktrees no longer receive an extra shell terminal when the caller provides the primary surface. Setup commands still queue without a terminal identifier. Focus restoration, setup splits, and issue-command splits are skipped in that mode. Structured launches also block default terminal creation until their launch status is idle. Tests cover caller-owned and absent surfaces, setup modes, issue automation, tab titles, and resulting tab counts.

Merge Risk: 🟠 High · up to 933a6

A structured chat launch that resolves without opening a chat can leave the workspace with neither a chat nor a fallback terminal. The fallback must remain eligible after launch resolution before this is merge-ready.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ 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 6 functions across 9 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the primary fix: preventing an unnecessary terminal beside native chat creation.
Description check ✅ Passed The description is detailed, focused, and explains the problem, implementation, scope, testing, and compatibility impact. It explicitly notes that no linked issue or visual attachment is provided, alt…
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.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

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.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

Renderer-only fix that stops a worktree create from seeding a stray empty Terminal 1 beside a structured native chat when the repo also returns a setup script. It threads providesInitialSurface through activation into ensureWorktreeHasInitialTerminal as callerProvidesSurface, and adds a narrow guard that skips shell seeding only when the caller owns the surface, no tabs are renderable, and the sole launch work is a new-tab setup. queueSetupAndIssueCommands now takes terminalTabId: string | null so setup still gets its own tab without a host terminal to split from or restore focus to.

  • Activation seam forwards the opt-out — activateAndRevealWorktree passes callerProvidesSurface: true through to seeding alongside the existing reseedEmptiedWorkspace flag.
  • Narrow seeding guard — worktree-initial-terminal-seeding.ts skips the shell when callerProvidesSurface is set and there is no startup / issue command / split-mode setup / default-tab work; splits and issue automation still seed a pane.
  • Nullable terminalTabId in the setup/issue queue — focus-restore, split, and issue-split paths gate on a non-null tab id; new-tab setup still creates its own Setup tab.
  • Tests — a 5-test suite covering new-tab, split-mode, issue automation, no-surface, and an end-to-end activateAndRevealWorktree forwarding case.

I verified the guard is unreachable in the split-drop case (it requires new-tab mode), that the hostAuthority === 'live' / SSH path returns before the guard, and that the structured-launch refusal fallback still re-seeds a real terminal. Ran the new suite plus the 12 related worktree-activation-* suites (96 tests) — all green.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

The follow-up commit extends the surface opt-out to the background completion route: when the user navigates away during a structured native-chat create (so activateAndRevealWorktree is bypassed and ensureWorktreeHasInitialTerminal is called directly), the stray shell is now suppressed too.

  • Background route forwards the opt-out — executeWorktreeCreation now passes callerProvidesSurface: true to ensureWorktreeHasInitialTerminal when structuredLaunch is set, mirroring the foreground route's providesInitialSurface forwarding.
  • Background-route integration test — the new worktree-creation-chat-setup.test.ts drives executeWorktreeCreation for claude/codex, asserting a single Setup tab, a null primary tab, preserved focus, and launchStructuredWorktreeSession({ primaryTabId: null, shouldActivateOnCompletion: false }).

I verified the background refusal fallback still seeds a real terminal (createNewTerminalForStartup: true with no callerProvidesSurface), that structured-native-chat is only ever routed for session-handle providers (agent-launch-routing.ts requires isAgentSessionHandleProvider), and that the guard ordering leaves the hostAuthority === 'live' SSH path unchanged. Ran both new suites (7 tests) — green.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Electron QA (Playwright CDP, hidden renderer)

Tested SHA: 933a61d11a64198d46202cd1d29b9b827f7ed4a5
App identity: Orca: brennanb2025/no-stray-terminal-on-native-chat-create (margate @ that branch)
Method: real Create worktree composer, disposable profile/repos, ORCA_BACKGROUND_LAUNCH=1, CDP screenshots of the hidden renderer. Coordinator confirmed this SHA as final before upload.

New-tab setup + Claude native chat — pass

Composer: Claude, orca.yaml setup echo "pr19123-setup-ok", Run setup on. Result: Setup | Claude Chat (chat focused), no Terminal 1 tab. Setup tab ran the setup runner.

composer
after create
setup tab

Backing: one tabsByWorktree entry { title: "Terminal 1", customTitle: "Setup" }; Claude Chat is a structured session tab.

No-setup + Claude native chat

On 47937e28d0 this still seeded a stray idle Terminal 1 beside Claude Chat:

nosetup fail
stray shell

Retest on 933a61d11a (Avoid passive terminal seeding during native chat launch): Claude Chat alone, tabsByWorktree: [].

nosetup pass

Split-vertical setup (neighboring; still seeds a host pane) — pass

Terminal 1 with vertical split (idle shell | setup runner) plus Claude Chat.

split create
split panes

Gaps

Codex UI create, background-create (navigate-away) path, structured-launch refusal fallback, SSH, and Windows were not exercised. New-tab setup was created before 933a61d11a and re-opened after reload (still Setup | Claude Chat, no stray Terminal 1) rather than created again from scratch on the final SHA.

Full writeup: /tmp/pr19123-electron-qa-report.md

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Team

Run ID: 9b3c67e2-ff6f-49a0-bdb0-ac44d7b82e7a

📥 Commits

Reviewing files that changed from the base of the PR and between 47937e2 and 933a61d.

📒 Files selected for processing (2)
  • src/renderer/src/components/terminal/initial-terminal-structured-launch.test.tsx
  • src/renderer/src/components/use-terminal-watcher-effects.ts

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

(agent) => getStructuredAgentLaunchStatus(activeWorktreeId, agent) !== 'idle'
)
) {
return

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Re-enable fallback after structured launch resolution.

At Line 170, this return occurs after the worktree is added to startupActivationGateWorktreeIdsRef. If the status is pending or unknown when the gate returns empty, a later transition to idle cannot run this activation path again for the same worktree.

Keep the worktree eligible until the structured launch resolves, or trigger one fallback activation when it resolves without publishing a surface. Add a regression test that changes pending to idle and verifies one terminal is created only when no chat tab exists.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Review completed at 933a61d11a64198d46202cd1d29b9b827f7ed4a5: four review/fix rounds, latest code review and final eight-category readiness audit clean. No remaining proven in-scope correctness or performance findings.

Two focused fixes were pushed:

  • 47937e28d0: background native-chat creation now preserves the caller-provided surface option, avoiding an extra shell when setup runs after navigating away.
  • 933a61d11a: the passive terminal watcher checks current native-chat launch status after its asynchronous inventory result, preventing an empty-shell race while Claude/Codex creation is pending or unconfirmed.

Regression tests failed before each fix and passed afterward. Final verification: 18 focused tests and 152 broader activation/creation tests passed; renderer typecheck, lint, React Doctor, formatting, and diff checks passed. The watcher adds at most two existing Map reads, with no new polling, subscriptions, timers, or retained state. Scope remains unwanted terminal creation; existing startup, split setup, issue automation, default-tab, and refusal-fallback behavior is preserved.

Grok's Electron screenshots and scenario report show setup plus focused Claude Chat, the no-setup failure before the watcher fix, chat alone after the fix, and the expected host pane for split setup. QA used the real composer and hidden CDP renderer; the disposable app/profile/repos were cleaned up and its CDP/renderer ports are no longer listening.

Remaining validation limits: Codex/background creation have deterministic regression coverage but were not exercised through the UI; refusal fallback, SSH, and Windows were not manually exercised. New-tab setup was created on the prior commit and reopened on the final commit. Latest-head CI is still queued/running, so this is a clean code-review result, not unconditional merge approval. Initial and final readiness audits were completed; the initial severity-counsel attempt was unavailable, and the final audit had zero candidate findings requiring counsel.

The pre-existing uncommitted pnpm-lock.yaml change was preserved and excluded from both commits. PR was not merged.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

The latest commit closes the final route that could seed the stray Terminal 1 during a native chat create: the passive, effect-driven path in useTerminalWatcherEffects that seeds a default shell once the activation gate reports empty.

  • Passive seeding guard — after gateWorktreeAgentActivation resolves empty, the effect now returns early when any session-handle provider (claude/codex) has a non-idle getStructuredAgentLaunchStatus for the active worktree, so a chat create in flight during the gate's async inventory is not shadowed by a shell.
  • Regression test pinned to the mechanism — initial-terminal-structured-launch.test.tsx drives the watcher effect with a held-open gate, flips the launch status to pending/unknown, resolves the gate, and asserts createTab was not called (once for idle).

The guard is narrow and correct: it reads only the active worktree's own launch state, only the two session-handle providers can enter startStructuredAgentLaunch, and a non-idle status means the create flow is already mid-launch and owns the surface. The refusal fallback still seeds a real terminal via activateAndRevealWorktree({ createNewTerminalForStartup: true }).

ℹ️ One boundary worth awareness

The effect's startupActivationGateWorktreeIdsRef is one-shot, so a worktree whose launch was pending/unknown at gate-resolution and then resolves to idle without publishing a surface is never re-seeded by this path. That leaves no tab only on a definitive generic failure — the structured-not-available refusal already seeds a fallback terminal, and generic failures surface an error toast. This matches the foreground route's behavior since the first commit, so it is a pre-existing boundary rather than a new regression; flagging it only so the create flow's error path can be revisited independently if "never leave a workspace dead" matters.

Pullfrog  | View workflow run | Using DeepSeek Pro (free via Pullfrog for OSS) | 𝕏

@brennanb2025
brennanb2025 merged commit 5a46703 into main Sep 6, 2026
32 of 34 checks passed
@OrcaWin

OrcaWin commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator

PR 19123 Windows QA — BLOCKED

PR: #19123
Requested merge SHA: 5a46703ce525ac141f5caca77bd1a421e97ea3a9
Assigned worktree: C:\Users\neil\orca\workspaces\orca\claude-shutdown-diagnostic-0906
Outcome: failed / blocked — no Windows UI validation was run, and no pass/fail claim is made about native-chat Create worktree tabs.

What was requested

Close the Windows QA gap left by the prior Electron QA comment on 933a61d11a (macOS, Claude new-tab setup / no-setup). Exercise native Claude/Codex Create worktree with new-tab setup and no-setup via hidden CDP, isolated profile, and disposable fixture repos. Verify visible tabs, setup output, and real backing PTYs: Setup + Chat with setup; Chat alone without setup. Navigate-away if feasible.

Constraints: assigned existing worktree only; never checkout/reset/clean/edit owner source; no new worktrees (cross-host parent lineage failed); ORCA_BACKGROUND_LAUNCH=1; $electron hidden CDP only; no computer-use fallback; no production edits; preserve dirty pnpm-lock.yaml; no commits.

Identity at first inspect (this worker, ~15:46 local)

Field Value
HEAD 5a46703ce525ac141f5caca77bd1a421e97ea3a9
git log -1 5a46703ce5 fix(native-chat): stop seeding a stray terminal beside a chat create (#19123)
Branch OrcaWin/claude-shutdown-diagnostic-0906
Worktree path C:/Users/neil/orca/workspaces/orca/claude-shutdown-diagnostic-0906
Merge SHA match yes at first inspect

Tracked dirt (owner diagnostic overlay, not PR 19123):

 M pnpm-lock.yaml
 M src/main/claude/claude-agent-sdk-exit-proof.ts
 M src/main/claude/claude-agent-sdk-process-spawn.ts
 M src/main/claude/claude-stream-json-connection.ts
 M src/main/claude/claude-structured-real-cli.test.ts
 M src/main/windows-descendant-exit-verification.test.ts
 M src/main/windows-descendant-exit-verification.ts
?? diagnostic-build-reader.cjs
?? diagnostic-instrument.cjs
?? diagnostic-matrix.cjs
?? diagnostic-old-cli-gate.cjs

git diff --stat at first inspect: 7 files, +76 / −5. Those paths are Claude runtime exit/spawn diagnostics, unrelated to native-chat stray-terminal seeding.

At first inspect, no process in this worktree was running pnpm / electron-vite / out/main. Other machines had unrelated Electron instances (C:\qa18519 on renderer :5173 / CDP 9511; acl-verify-18361). Those were not touched.

Coordinator stop

Inbox messages on Dispatch ctx_22390ee1fe99:

  1. Subject: Dirty checkout is blocked; preserve owner work
    Do not build or launch from this checkout. Finish as Windows QA blocked by dirty exact-SHA checkout and cross-host lineage: active parent rejected invalid_argument; explicit coordinator worktree parent rejected LINEAGE_PARENT_NOT_FOUND. No more search or alternate checkouts. Send failed worker_done with precise evidence and no UI validation claims.

  2. Subject: Read coordinator inbox before more work
    Unrelated dirty Claude runtime source means no QA build from assigned checkout. Stop source exploration; report and settle failed worker_done. Do not touch owner files or launch app.

This worker did not launch Orca, did not attach CDP, did not create fixture repos, and did not mutate owner files. A recursive skill-directory search (Get-ChildItem over .grok / .agents / .orca) was started, exceeded timeout, and was killed (call-95df4e97-42fa-4f8c-82ae-16b05985439f-9). No owner PID was killed.

Identity at stop (~15:52 local) — owner moved the checkout

The assigned worktree is no longer at the requested merge SHA. Owner processes are live.

Field Value
HEAD now 933adf43d2f549afd93ec0344b111de15db0920c
Subject fix(windows): reject stale parent PID links in exit snapshots
Author / date Merge Sim / 2026-09-06 15:47:41 -0700
git name-rev remotes/origin/brennanb2025/fix-windows-stale-parent-pids
Branch detached (git branch --show-current empty)
Requested merge SHA still in object db yes (5a46703ce525ac141f5caca77bd1a421e97ea3a9)
5a46703 ancestor of current HEAD yes (merge-base --is-ancestor exit 0)
Current HEAD is merge SHA no

Tracked source diffs are now clean. Untracked owner diagnostic files grew:

?? diagnostic-build-reader.cjs
?? diagnostic-electron-launch.pid
?? diagnostic-electron.config.mjs
?? diagnostic-instrument.cjs
?? diagnostic-investigation.patch
?? diagnostic-matrix.cjs
?? diagnostic-old-cli-gate.cjs
?? diagnostic-ui-current.txt

Live owner processes whose command line contains this worktree path (not killed):

PID Name Evidence
26024 node.exe electron-vite.js dev -c diagnostic-electron.config.mjs --remote-debugging-port=9347 from this worktree
16964 esbuild.exe worktree-scoped
49860, 48880, 54004, 51932, 37396, 53760, 51444 electron.exe worktree Electron (49860: electron.exe . --remote-debugging-port=9347)
55200 OpenConsole.exe worktree-scoped

Building or attaching to this instance would validate the owner's Windows stale-parent-PID diagnostic checkout, not PR 19123 at 5a46703.

Why a clean Windows QA of 5a46703 could not proceed

  1. Dirty exact-SHA checkout (first inspect): assigned worktree reported merge SHA but overlayed unrelated Claude spawn/exit diagnostic source + dirty pnpm-lock.yaml. Coordinator forbade build/launch from that tree. This worker was not allowed to stash, reset, checkout, or edit owner files.
  2. Owner later moved HEAD and launched Electron: by stop time the same path was detached at 933adf43d2 with a live electron-vite on CDP 9347. Concurrent owner build is an explicit block.
  3. No alternate worktree: task and coordinator both forbade new/nested checkouts. Cross-host parent lineage already failed (invalid_argument / LINEAGE_PARENT_NOT_FOUND).
  4. No UI validation: $electron skill exists on disk at C:\Users\neil\.codex\skills\electron\SKILL.md (not via orca skills get electron), but it was not used after the stop order. Playwright CDP was not attached. No screenshots.

What remains

Windows native Claude/Codex Create worktree (new-tab setup / no-setup, plus navigate-away if feasible) is still unverified on 5a46703ce525ac141f5caca77bd1a421e97ea3a9. Prior public Electron QA remains the macOS comment on 933a61d11a (#19123 (comment)), which already listed Windows as a gap.

To close the gap, a clean Windows checkout of exactly 5a46703ce525ac141f5caca77bd1a421e97ea3a9 with no concurrent owner Electron/vite, plus lineage-valid worktree placement, is required. Do not reuse this path while the owner's diagnostic Electron on CDP 9347 is live.

Cleanup

  • Owner profile, repos, PIDs, and worktree files: preserved.
  • This worker created no profile, no fixture repos, no Electron PID, no screenshots.
  • Recursive skill search process: terminated (this worker only).

Screenshots / CDN

None. No UI session was started; there are no image attachments.

@brennanb2025

brennanb2025 commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor Author

Gap QA (local hidden Electron) — PARTIAL on 933a61d11a

Coordinator inspected screenshots: normal and background cases PASS. Refusal is not PASS — screenshot 25 shows PTY exhaustion, so a usable fallback terminal was not proved. Local gaps are not all closed. SSH lane will retry local refusal on a fresh app. Full report: /tmp/pr19123-gap-qa.md. Screenshots kept at /tmp/pr19123-gap-qa/screenshots/.

Hidden CDP, ORCA_BACKGROUND_LAUNCH=1, disposable profile. Real Create worktree composer. No source edits.

Codex no-setup — PASS (Codex Chat only, 0 terminals)

05-codex-nosetup-chat-only.png

Codex new-tab setup — PASS (Setup | Codex Chat)

09-codex-setup-after-create.png
10-codex-setup-tab-output.png

Claude fresh new-tab setup on final SHA — PASS (Setup | Claude Chat)

12-claude-setup-after-create.png
13-claude-setup-tab-output.png

Background create (Settings app view) Claude — PASS (view/workspace preserved)

16-claude-bg-after-complete-still-settings.png
17-claude-bg-created-surface.png

Background create (Settings app view) Codex — PASS

21-codex-bg-after-complete-settings.png
22-codex-bg-created-surface.png

Structured-launch refusal fallback — PARTIAL (injected; tab seeding proved, usable PTY blocked)

Tab strip became Terminal 1 with launchAgent: claude (no structured chat). Screenshot 25 is PTY exhaustion (DaemonProtocolError: Your system cannot allocate any more pty devices). That is not a usable-fallback PASS.
24-refusal-after-create.png

Disclosed injections restored: 8s createWorktree delay; WSL-bound Claude managed-account gate on the disposable profile. Six disposable qa-* worktrees, fixture repos, and the isolated profile were removed after this correction. Screenshots/report retained.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

SSH gap QA (throwaway Linux Docker) — 933a61d

Full report: /tmp/pr19123-gap-ssh.md. Hidden CDP screenshots kept at /tmp/orca-ssh-pr19123-1788735040/screenshots/ (not committed).

Local refusal (requested before SSH): WSL-bound Claude account injection, restored immediately. Composer create sshqa-claude-refusal on a fresh nosetup repo. Tab strip is only Terminal 1 (Claude chat chrome). Live PTY: zsh + claude --dangerously-skip-permissions in the worktree. Closes the prior exhausted-PTY gap.

SSH Create worktree (real UI, demo-project on linux-arm64 Docker sshd, relay deployed):

  • Connect 127.0.0.1:57057 → status=connected, remotePlatform=linux. Remote git worktree created at /work/demo-project-sshqa-ssh-claude-setup.
  • Claude + setup: tab strip Terminal 1 | Setup. Terminal 1 is native-chat chrome (launchAgent: claude, viewMode: chat) on an SSH PTY (ssh:…@@pty2:…). Setup tab ran setup-runner.sh on the container (ORCA_SETUP_TEST_START/END, prompt root@08c74f9bb3c9:/work/demo-project-sshqa-ssh-claude-setup#). No third empty Terminal.
  • Structured native chat is intentionally not used over SSH (legacy-native-chat when executionHostId is ssh:…). Terminal 1 is the chat surface, not a stray shell.

Limits: a true no-setup SSH create was not isolated (composer used default-branch main, which still has orca.yaml; package.json setup detection also fired). Codex not driven over SSH. Container Claude was a stub for detection/PTY.

No source edits. pnpm-lock.yaml left dirty. Disposable container/profile/keys cleaned. User saved SSH targets untouched.

enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…tablyai#19123)

* fix(native-chat): stop seeding a stray terminal beside a chat create

A native-chat worktree create activates with `providesInitialSurface: true`,
meaning "I open my own primary surface, don't seed a shell". Activation only
honoured that when there was no other activation work, so any repo returning a
setup script fell through to `ensureWorktreeHasInitialTerminal`, which created a
bare terminal purely to act as the primary tab before giving setup its own tab.
The user landed on `Terminal 1` + `Setup` + `Claude Chat`.

The bare terminal was never needed for a new-tab setup: `queueSetupAndIssueCommands`
only uses the primary tab there to restore focus to it.

Forward `providesInitialSurface` into seeding as `callerProvidesSurface`, and skip
the shell when the launch work needs no host tab. A terminal is still seeded when
something has to attach to it: a startup command, issue automation, a split-mode
setup script, `createNewTerminalForStartup`, or configured default tabs.

* Fix background native chat setup terminal seeding

* Avoid passive terminal seeding during native chat launch

---------

Co-authored-by: Merge Sim <sim@local>
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.

2 participants