Repository navigation
Reserve the Git Bash capacity overlay for untouched Windows startup failures - #16991
Conversation
…rminal open #16045 retained every non-zero local PTY exit and only used the Git Bash console-capacity marker to pick the overlay's label, so an ordinary shell exiting after a failed command left a dead pane behind on macOS and Linux too. Claim the exit for the capacity overlay only when all of it holds: a native local Windows ConPTY pane, a non-zero code, the same PTY whose fresh spawn was observed, no user input on that PTY (an unsettled write counts), and the exact MSYS marker in that PTY's own output. Every other exit falls through to the unchanged teardown path. Per-PTY interaction rides on the existing per-PTY process-exit record, marked at the input-forward chokepoint so a late write acknowledgement can never label a replacement PTY. STA-5604
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the
Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review.
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 4a16616f-d763-4e26-aaef-061fbbc5de96
📒 Files selected for processing (4)
src/renderer/src/components/terminal-pane/pty-connection-git-bash-console-capacity.test.tssrc/renderer/src/components/terminal-pane/pty-connection-pty-exit-teardown.test.tssrc/renderer/src/components/terminal-pane/pty-connection/pty-exit-hibernate.tssrc/renderer/src/components/terminal-pane/pty-connection/pty-input-forward.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 2 remain after this review.
Gate-level ablation of the six-clause capacity condition found the six conjuncts each individually pinned, but two neighbouring arms free: - the `session.deps.onPaneProcessDied` presence check. The callback is optional on PaneConnectionDeps; without the guard a capacity exit calls `undefined` and throws out of the exit handler, leaving the pane neither retained nor torn down. - the per-PTY keying in `noteTerminalInputForPty`. A generation installs its exit state when its callbacks are captured, before the transport rebinds its PTY id; a write in that window would be credited to the incoming PTY and silently suppress its capacity overlay. Both new tests fail with their own arm reverted and pass with it restored. No production change.
Gate-level ablation audit — the six conjuncts hold; two neighbouring arms were freeStanding audit for "is any conservative arm only jointly pinned?". Each clause of the retention condition and each surrounding guard was reverted alone, all others intact, against The narrowing condition is genuinely pinned clause by clauseEvery one of the six conjuncts goes red on its own, each caught by a distinct test — this is exactly what the audit was looking for and did not find elsewhere:
Deleting the whole retention branch reddens four preservation tests, so the positive half is covered too. The Two arms outside the condition were unpinned — both fixed here
Both fail with their own arm reverted and pass with it restored. Notes
|
Review loop r1 — verdict PATCH, no defects found, no changes pushedReviewed at The honest-coverage claim holds — and it is now provable, not just assertedThe claim is that 6 of the tests logically cannot fail pre-fix because pre-fix retention was a
Worth recording: the coercion asymmetry Corrected accounting — the body's "9 fail-first / 6 preservation" is now staleReverting both production files to So it is 10 fail-first / 7 preservation, not 9/6 — Per-gate ablation — every gate reverted ALONE, by deletionAblated by deleting each clause, never by
No gate is unpinned, and no two gates redden only together. A9 still reddens all four positive
|
There was a problem hiding this comment.
Actionable comments posted: 1

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
d898de1a-e586-4326-8748-e921780e1687
Files selected for processing: 14-
src/renderer/src/components/terminal-pane/deferred-split-pane-handoff.test.tssrc/renderer/src/components/terminal-pane/deferred-split-pane-handoff.tssrc/renderer/src/components/terminal-pane/pty-connection-git-bash-console-capacity.test.tssrc/renderer/src/components/terminal-pane/pty-connection-pty-exit-teardown.spec.tssrc/renderer/src/components/terminal-pane/pty-connection-types.tssrc/renderer/src/components/terminal-pane/pty-connection/pane-pty-visibility-bind.tssrc/renderer/src/components/terminal-pane/pty-connection/pane-transport-options.tssrc/renderer/src/components/terminal-pane/pty-connection/pty-exit-hibernate.tssrc/renderer/src/components/terminal-pane/pty-connection/pty-input-forward.tssrc/renderer/src/components/terminal-pane/pty-transport-types.tssrc/renderer/src/components/terminal-pane/pty-transport-user-input.test.tssrc/renderer/src/components/terminal-pane/pty-transport.tssrc/renderer/src/components/terminal-pane/terminal-launch-input-attempt.tssrc/renderer/src/components/terminal-pane/terminal-pane-pane-created.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
-
|
Ordinary nonzero shell exits could show the Git Bash capacity overlay, including on macOS and Linux. This change limits that overlay to a fresh native Windows ConPTY, an exact live capacity marker, a proven nonzero natural exit and no applicable renderer-observed input attempt. Existing sole-newborn/direnv and fresh-split protections remain; other failed panes can still stay open through those guards. The full review completed three runtime rounds. It repaired automatic focus-report classification and made input observation follow its launch through pending connection, remounts, rejected buffering and direct renderer commands. Fresh correctness, consumer and whole-mechanism reviewers accepted the repair; the convergence decider kept the selected design. The final main merge preserved all 14 reviewed production/test blobs and patches. Later commits 8bc2a5c and e08285a change tests only. Verification: four focused suites passed 142 tests, including one/two-remount regressions that failed before repair; the affected capacity suite passed 29 tests after its fixture correction. Normal pre-commit checks passed. CI is green on e08285a after a failed-jobs-only retry of inherited SQLite fixture cleanup. Windows shell QA ran at 50ce70f against base f06399f; the later test-only commits preserve this evidence. The isolated Windows shell round and targeted setup supplement are complete. Normal UI setup approval produced the expected setup output and real git result. Clearing the agent selection chooses Setup only on both base and branch, so that route correctly skips the configured default tab. The tiny failure shell is not a real agent. No Claude/Codex session, reply or waiver is claimed. The rare pending-cwd/remount/exit-before-flush app timing was not exercised; production renderer tests prove that state contract. The 128-console limit itself was not reached in QA: it is PC-wide and would stop every terminal on the shared test PCs; the failure was reproduced with Git Bash’s exact output. No runtime finding remains deferred from this PR. A P3 assertion gap for the optional main-owned layout test mode is tracked in STA-13025. The inherited SQLite test-fixture cleanup issue is tracked separately in STA-13026; neither separate fix was folded into this PR. The existing renderer-live diagnosis boundary remains temporary and is independently tracked in #36422. For Brennan's reviewThe genuine-input control recorded input ending at 20:36:57.517Z, exact128 output at 20:37:02.224Z and native/daemon exit256 at 20:37:02.287Z. That touched tab then closed; its image shows the surviving prior near-marker tab. The base ordinary-failure image has a first-run tip from its fresh QA home; its exit overlay remains unobstructed. Three source spots: launch-owned attempt context, observation before admission/ACK, and capacity-only exit predicate. Evidence limits: the capacity fixture's native and daemon exit256 were recorded; its exact renderer number was not captured. The real capacity overlay proves the renderer's nonzero condition passed. A separate ordinary failure directly recorded native1→renderer1. The original graceful keep-children stop receipt was overwritten; the upgrade evidence uses a labelled reconstruction corroborated by original process identities, carried PTYs and the useful post-upgrade action. Real-config before/after hashes match. No PC-wide saturation or real-agent result is claimed. |

















An ordinary nonzero local shell exit could display the Git Bash console-capacity overlay, including on macOS and Linux. The renderer retained every failed local process rather than limiting this overlay to its known Windows failure.
Only a freshly spawned native Windows ConPTY with a nonzero natural exit, the exact capacity marker in live output, and no applicable renderer-observed input attempt can claim that overlay. Automatic focus reports do not count as user input. Attempts stay with their launch across a pending split remount, even when buffering rejects the input, and cannot contaminate a replacement process. Existing sole-newborn/direnv and fresh-split protections remain; other exits can still retain a pane through those guards.
The full review completed three runtime rounds, repairing automatic-focus classification and launch-owned input observation. Fresh correctness, consumer and whole-mechanism reviewers and the convergence decider accepted the repair. Four focused suites passed 142 tests, including regressions that failed before repair. The affected capacity suite passed 29 tests after a test-only fixture correction. Normal pre-commit checks and CI pass on e08285a; CI needed a failed-jobs-only retry of an inherited SQLite fixture cleanup failure.
Isolated Windows validation at 50ce70f covered the capacity overlay, Restart through a real Bash echo, Close with a useful survivor, ordinary failure, input and Quick Command exclusions, protected newborn/split controls, clean/near-marker controls and previous-build carried terminals through upgrade. A targeted supplement exercised normal setup approval and useful setup output. Clearing the agent selects the existing Setup only route, which deliberately skips default tabs on base and branch. Later commits 8bc2a5c and e08285a change tests only and preserve this evidence.
The 128-console limit itself was not reached in QA: it is PC-wide and would stop every terminal on the shared test PCs; the failure was reproduced with Git Bash’s exact output.
The capacity renderer's exact numeric exit value was not captured; the actual overlay proves its nonzero gate passed. Its native/daemon value was 256; an ordinary failure separately recorded renderer1 from native1. The original graceful upgrade stop receipt was overwritten; the evidence uses a labelled reconstruction corroborated by original process identities, carried PTYs and useful post-upgrade action. No real-agent run or waiver is claimed: the changed run rows are generic Windows shell process and recovery flows; rare remount timing and generic input contracts are covered by production renderer tests. Screenshots and detailed evidence are in the final review status comment.
The overlay continues to depend on live output and input observed through its renderer. Host-side startup diagnosis for CLI, orchestration and paired callers is independently tracked in #36422; either change can land alone. No default-cap or saved-data change.
Tracked in https://linear.app/stably/issue/STA-5604
Review path: full (terminal lifecycle and failure handling).
Deferred: the optional main-owned layout test-mode assertion gap is tracked in STA-13025. Inherited SQLite fixture cleanup is tracked in STA-13026. Neither changes production exit handling or was folded into this PR.