Repository navigation
Explain Git Bash console exhaustion when terminal startup fails - #36422
Conversation
|
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-
- 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:
ebd25195-7845-4f28-8a0e-c83c7f421e57
Files selected for processing: 21-
src/main/daemon/daemon-pty-adapter-replacement-exit-race.test.tssrc/main/daemon/daemon-pty-adapter-test-harness.tssrc/main/daemon/session-initial-output.tssrc/main/daemon/terminal-host-agent-session-claim.tssrc/main/daemon/terminal-host-agent-session.test.tssrc/main/daemon/terminal-start-failure.test.tssrc/main/ipc/pty/pane/agent-session-owners.tssrc/main/ipc/pty/pane/complete-pane-adoption.tssrc/main/ipc/pty/pty-agent-launch-pane-attach.test.tssrc/main/ipc/pty/pty-controller-spawn-admission.test.tssrc/main/ipc/pty/runtime/spawn-commit-run-facts.test.tssrc/main/ipc/pty/spawn-commit-assembly.tssrc/main/ipc/pty/spawn-execute.tssrc/main/ipc/pty/spawn-outcome.tssrc/main/runtime/launched-agent-composer-readiness.tssrc/main/runtime/rpc/methods/agent-launch-replay.test.tssrc/main/runtime/terminal-list-pending-pty-registration.test.tssrc/main/runtime/terminal-start-failure-readiness.test.tssrc/main/runtime/terminal/launch/terminal-create.tssrc/main/runtime/terminal/lifecycle/pty-registration.tssrc/shared/terminal-start-failure.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
-
|
Git Bash can reject new terminals at its PC-wide 128-console limit while existing terminals keep working. Previously the app window alone recognized the message, leaving CLI, orchestration and paired callers with generic startup failures. The process owner now retains the original first 4,096 UTF-16 code units and attaches only an allowlisted observation to a confirmed natural positive exit. Actual fresh-start producers classify that failure before sharing it, so existing consumers can explain what happened and ask users to close some Git Bash terminals and retry. Ordinary/reused-terminal waits remain generic; uncertainty, exact incarnation handling, cleanup and the running-terminal default remain unchanged. Observed death before publication rejects creation, and later registration retains its existing real output-before-exit drain. Five source review rounds completed. Repairs addressed raw-prefix ordering, fresh readiness after an observed exit, actual producer freshness through joiners/recovery, retained history closures, and workspace warning presentation. Final reference comparison and bounded-work review agreed with the common pattern and the settled intended adaptations. Later CI integration repairs change tests only; the captured-output fixture preserves its exact bytes on Windows. Normal pre-commit checks passed. Real renderer tests cover the ordinary toast and not-started/unconfirmed notices, including the async footer order separately. Windows QA exercised actual native output/cause, the allowlisted daemon diagnosis, a fresh worker consumer failing before Task dispatch at its existing 60-second deadline, ordinary recovery, carried state and two real prompts/replies each with Claude and Codex. The failure bytes came from the installed DLL's exact format; they were not captured by exhausting the PC. Ordinary Windows create returned before the fast fixture exited, so native ordinary-create prepublication/registration rejection was NOT EXERCISED. Production admission/control/error-transport tests prove that contract. Component screenshots prove copy/wrapping only, not native/producer/RPC delivery; the sample pre-appended footer appears before the issue link, unlike the ordinary async footer path. 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. Evidence limitations: Claude's recovery image captures its first reply; retained stage data proves its second. The original baseline graceful-stop receipt was unavailable; its provenance is a console transcript. Worker-to-PTY correlation combines source enforcement with timing/uniqueness rather than a serialized direct join. Cleanup receipts are scoped to their retained timestamps. A shared-machine real-config hash changed with unknown attribution and without contents being read. A QA lead disclosed a prohibited variable-built deletion of its own package-copy log; the audited packet remains intact and remote original retention is lead-attested. Main's known-exit wait correction #36457 is now included through merge5622a42aa692d0f3763b1c0be4a414de81554efe. Independent narrow integration review agrees that main's neutral lifetime/error builder and this PR's actual creation classification are preserved. The two stale generic/reused test expectations were corrected without runtime changes, and the same independent auditor agreed with that final delta. All161 tests in the four focused files passed, including the six original readiness failures; normal pre-commit passed. CI on final head 31119318b8fad16e5dc4d38602e93918285ad253 passed, including all twelve unit shards, actual enabled typecheck compilation, Windows persistence/package/D7, and WSL. The branch is clean, out of draft, conflict-free, and has no unresolved review threads. No in-scope findings remain. Reviewed source head: 3111931. Windows QA runtime head: 227a8e6 (baseline f22a7d4); retained across main integration 5622a42 and the non-shipped commits 675593f, b1e10dc,36d3c97b,216f5f69,38e30714,c3995ea4,4365fa0f,31119318. Component screenshots rendered c399 shipped code, unchanged by later test-only commits and the inspected merge seams. No changed run flow was shown broken, so evidence carries under the main-merge rule. For Brennan's review: Baseline and branch both show the existing overlay after accepted creation; these are not early-rejection proof. Branch existing overlay, same fixture. CLI terminal creation was accepted then exited. CLI agent argv handoff was accepted then exited; this does not assert readiness. Fresh worker reports one actionable failure at the existing deadline; no Task dispatched. Claude normal recovery: image shows first reply; stage data separately records second. Codex normal recovery and genuine replies. State created by the baseline before upgrade. Carried state after restart/upgrade. English real component fixtures at narrow width: not started, unconfirmed with Copy prompt, ordinary toast. Sample footer pre-appended; rendering only. Chinese real components: translated uncertainty/Copy prompt/issue link with current English capacity fallback. Sample footer; rendering only. Judgment spots: producer classification, prepublication rejection, physical-PTY exit settlement. Initial main sync b85f734 preceded QA227. The later main merge5622a42 was the authorized blocking-main-fix integration for #36457, independently reviewed on the final head; successful readiness policy and the QA'd run flows remain unchanged.
|
…aky tests The ConPTY prelude mock delivered its DA1 query on a microtask, which reached only the physical owner's early onData listener (added in #36422); the startup watch subscribes after an await, never saw it, and every Windows-path spawn waited out CONPTY_STARTUP_DECISION_LIMIT_MS (5 s). Deliver it on a macrotask like real output. Also give two fixtures the readiness their production peers provide, and fix the counter-file race in structured-agent-shell-environment and the async sign-in marker race in claude-status-sign-in.
…aky tests (#37362) The ConPTY prelude mock delivered its DA1 query on a microtask, which reached only the physical owner's early onData listener (added in #36422); the startup watch subscribes after an await, never saw it, and every Windows-path spawn waited out CONPTY_STARTUP_DECISION_LIMIT_MS (5 s). Deliver it on a macrotask like real output. Also give two fixtures the readiness their production peers provide, and fix the counter-file race in structured-agent-shell-environment and the async sign-in marker race in claude-status-sign-in.











When Git Bash reaches its PC-wide limit of 128 consoles, new terminals can fail while existing terminals keep working. Orca detected the message only in the app window, so CLI, orchestration and paired callers could receive a generic startup error and the daemon log omitted the cause.
The process owner now recognizes the existing marker in its original first 4,096 UTF-16 code units. A confirmed natural positive exit carries that observation through existing failed-start paths. Callers receive an explanation and a request to close some Git Bash terminals and retry; the daemon records only the allowlisted reason, exit status and terminal identity. Internal error codes, launch uncertainty and cleanup remain intact. The running-terminal default stays unchanged.
The implementation follows the common pattern: the process owner retains bounded startup evidence and the actual fresh-start producer classifies the existing failure before sharing it. Intended adaptations preserve mixed-version generic fallback, exact terminal incarnations, ordinary/reused-terminal generic errors and the existing later-registration output drain. Constructor-time observed death rejects creation before publication. The ordinary renderer overlay still depends on bytes delivered to that view; structured launch failures carry the reason separately. The independent overlay retention correction is tracked in #16991.
Review path: full (process lifecycle, failure handling and additive daemon/IPC error details). Five source review rounds, the design settlement, final reference comparison and bounded-work audit completed. No saved diagnostic field, new operation, cap or default change. Subsequent CI integration repairs affect tests only. CI supplies lint and typecheck.
Windows QA used an isolated real Git Bash process with failure bytes derived from the installed DLL's exact format; this was not a capture of physical exhaustion. Native observation, allowlisted daemon diagnosis, a fresh worker's failed-start consumer, normal recovery and two genuine prompts/replies each with Claude and Codex were exercised. The fresh-worker result surfaced the actionable failure at its existing 60-second deadline, with no Task dispatched. Ordinary Windows creation returned before the fast fixture exited, so native ordinary-create early rejection was not exercised. Production admission/error-transport tests cover that contract; renderer tests and separate component screenshots cover copy and wrapping. These proofs are distinct.
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 English and Chinese component screenshots show three isolated real-component cells at a narrow width. They prove rendering only, not native/producer/RPC delivery. The toast uses a pre-appended sample environment footer to avoid real environment lookup, so the pictured footer appears before the issue link; production loads it asynchronously after the link. The Claude recovery screenshot captures its first reply; retained stage data proves the second. Baseline graceful-stop evidence is a console transcript, not the unavailable original receipt. Scoped cleanup evidence is retained. One real config hash changed on the shared machine; attribution is unknown and no contents were read. A QA lead disclosed deleting its own package-copy log with a prohibited variable-built path; the audited evidence packet remains intact, and the original remote log's retention is lead-attested.
Main's known-exit wait fix #36457 is included through the authorized integration merge 5622a42. Independent narrow review agreed with the integration and the two test-only expectation repairs at final head 3111931. All 161 tests in the four focused files passed, including the six previously failing readiness cases; normal pre-commit passed. CI passed on final head 3111931, including all twelve unit shards, enabled typecheck compilation, Windows persistence/package/D7 and WSL. The full review loop and required evidence are complete; merge approval remains pending.
Component rendering evidence (sample footer pre-appended; not native delivery):