Repository navigation
chore(terminal): retire unsupported React #185 parking hypothesis - #14653
brennanb2025 wants to merge 6 commits into
Conversation
📝 WalkthroughWalkthroughTerminal cold parking now uses a shared selector for rendered parked tabs. Watcher synchronization filters deferred tabs that lack coverage and reports failed handoffs. Terminal surfaces forward the failure callback and reveal affected tabs. New React 18.5 regression tests cover deferral, coverage, portals, policy changes, paired-runtime changes, and capability flapping. Reliability-gate configuration registers the tests and their coverage metadata. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
src/renderer/src/components/terminal-pane/terminal-rendered-park-verdict.ts (1)
1-9: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueThe header calls the module pure, but the selector writes to the latch during render.
selectRenderedParkedTerminalTabIdsruns inside auseMemo, andlatchDeferredParkCoverageinserts intoargs.deferredParkCoverageLatch. The write is idempotent per material key, so StrictMode double invocation is safe, but the module is not pure. Reword the header to state that the selector owns a documented render-phase memo write into the caller's latch. Accurate wording here prevents a future change from assuming it is safe to call this selector speculatively.src/renderer/src/components/terminal-pane/terminal-cold-park-reveal-storm.react185.test.tsx (1)
324-331: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueStorm statistics print on every run in both harnesses. Each site calls
console.infounconditionally before the assertions, so passing runs emit diagnostics into CI output. Attach the statistics to the assertion message, or print them only when an assertion is about to fail.
src/renderer/src/components/terminal-pane/terminal-cold-park-reveal-storm.react185.test.tsx#L324-L331: gate the[reveal-storm stats]block onthrown !== nullor move the counters into theexpectmessages.src/renderer/src/components/terminal-pane/terminal-cold-park-reveal-storm.react185.test.tsx#L550-L559: gate the[runtime-flap stats]block the same way.src/renderer/src/components/terminal-pane/terminal-cold-park-reveal-storm.ack-contract.react185.test.tsx#L354-L363: gate the[reveal-storm A/B stats]block the same way.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 607711a7-263d-4519-9ea2-64a5077a1440
📒 Files selected for processing (6)
src/renderer/src/components/terminal-pane/terminal-activation-deferred-park-latch.test.tssrc/renderer/src/components/terminal-pane/terminal-activation-deferred-park-latch.tssrc/renderer/src/components/terminal-pane/terminal-cold-park-reveal-storm.ack-contract.react185.test.tsxsrc/renderer/src/components/terminal-pane/terminal-cold-park-reveal-storm.react185.test.tsxsrc/renderer/src/components/terminal-pane/terminal-rendered-park-verdict.tssrc/renderer/src/components/terminal-pane/use-terminal-tab-cold-parking.ts
9da3236 to
b609c76
Compare
Exact-final-head Electron QA @
|
… reveal storm Crash cluster 05ed75b1/996b4cc2/fe2b1a30 (1.4.180/1.4.182). The activation-deferred park clause re-asks canWatcherCoverParkedTerminalTab at render time, and the flip-burst pin only subtracts from the cold-park candidate set, so coverage feedback through watcher-mutated state loops park -> title write -> unpark -> title write until React throws #185. Two files, currently FAILING by design (the fix is not written yet): - reveal-storm: trips #185 on main; two neutralization controls pass, and a paired-runtime flapping case reproduces the field churn signature (window-trigger crumb, no pin, remount thrash, no crash). - ack-contract A/B: same storm against both watcher contracts; fails on main via the legacy path, passes on nwparker/react185-structural-fix.
…l identity The rendered parked-set memo re-asked canWatcherCoverParkedTerminalTab on every render for activation-deferred tabs, and that predicate reads state the park/reveal lifecycle itself rewrites (pane captures, layouts, runtime titles). A park unmount could therefore flip the verdict that caused it, and the flip-burst pin never reaches this clause — it only subtracts from the cold-park candidate set — so the loop ran to React #185 (terminal.workbench crash cluster 05ed75b1/996b4cc2/fe2b1a30). Break the feedback edge instead of damping its frequency: evaluate coverage once per material identity (pty id, generation, restore policy) and hold that verdict while the tab stays deferred. No pane mount/unmount can write any latch input, so the verdict cannot oscillate; pty re-mints, generation bumps, SSH-parking setting changes, and paired-runtime capability changes still re-open it, and reveal (leaving the deferred set) clears the latch entirely. The rendered-verdict selection moves to terminal-rendered-park-verdict.ts (pure function of committed inputs) to keep the hook under the max-lines budget. Cold-park and force-park lanes are untouched; the existing withhold damping and flip telemetry still govern the cold-set lane. Repro gate: terminal-cold-park-reveal-storm.react185.test.tsx goes RED (Maximum update depth exceeded) to GREEN with this change alone; both neutralization controls and the paired-runtime flapping case stay green.
…atch Adversarial review mutation testing found four surviving mutants in the latch integration seam (the latch unit tests and both storm repros stayed green through all of them): - evaluateCoverage hardcoded true: an uncoverable deferred tab was silently claimed by watchers (the zero-watcher-darkness direction the coverage gate exists for). New: 'keeps an uncoverable deferred tab out of watcher ownership'. - portal guard dropped from the extracted deferred clause. New: 'never claims a portal-hosted deferred tab for watchers'. - restore policy hardcoded in the hook (and the two new memo deps dropped): the SSH kill switch and paired-capability re-key edges were unproven end-to-end. New: 're-opens the latched verdict on restore-policy changes and settles' — also demonstrates each re-key settles in one evaluation. - prune wiring removed from the hook: a stale FALSE surviving a reveal -> re-defer cycle would strand the re-deferred tab unmounted and unwatched. New: 're-evaluates fresh when a revealed tab is deferred again'. Also resets settings/runtimeStatusByEnvironmentId in beforeEach so the new policy-change case cannot leak state into the runtime-flap case.
b609c76 to
16d1b4d
Compare
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: c5d4c806-1b88-460e-914f-0c4b3769c9c0
📒 Files selected for processing (8)
config/reliability-gates.jsoncsrc/renderer/src/components/Terminal.tsxsrc/renderer/src/components/terminal-pane/TerminalPaneOverlayLayer.tsxsrc/renderer/src/components/terminal-pane/terminal-cold-park-reveal-storm.react185.test.tsxsrc/renderer/src/components/terminal-pane/terminal-rendered-park-verdict.tssrc/renderer/src/components/terminal-pane/use-parked-terminal-watcher-synchronization.react185.test.tsxsrc/renderer/src/components/terminal-pane/use-parked-terminal-watcher-synchronization.tssrc/renderer/src/components/terminal-pane/use-terminal-tab-cold-parking.ts
🚧 Files skipped from review as they are similar to previous changes (3)
- src/renderer/src/components/terminal-pane/terminal-cold-park-reveal-storm.react185.test.tsx
- src/renderer/src/components/terminal-pane/terminal-rendered-park-verdict.ts
- src/renderer/src/components/terminal-pane/use-terminal-tab-cold-parking.ts
Exact-final-head Electron QA @
|
|
Closing: this branch has zero net diff against main and there is nothing left to merge. The merge-gate review disproved the causal path this PR claimed, and the implementation, its oracle, and the reliability-gate registration were all reverted (b69c565). Two independent reasons:
Consequence: the React #185 Corrections have been posted on the three affected crash reports and in the sweep summary. |


Status: close this PR
Final-readiness review disproved the causal path this PR claimed. The branch now has zero net diff against
origin/main; commitb69c5656bcremoves the speculative implementation, the watcher-state oracle, and its reliability-gate registration. This PR should close rather than merge.Production causal trace
canWatcherCoverParkedTerminalTab(worktreeId, tab, isPtyEligible)has these real inputs:worktreeId,tab.id, andtab.ptyId.capturedPanesByTabId, or the fallback derived fromterminalLayoutsByTabIdplus the keys ofruntimePaneTitlesByTabId.settings.terminalSshViewParking, paired-runtime capability state fromruntimeStatusByEnvironmentId, and terminal-provider snapshot capability state.The writers do not form the reported feedback cycle:
capturedPanesByTabIdonce from the live PaneManager. Tab/worktree retirement and pruning delete captures. Watcher start and dispose do not write captures.terminalLayoutsByTabId. A parked watcher can change layout only when a PTY actually exits and a split leaf collapses; ordinary watcher start, title restore, and disposal do not change layout.runtimePaneTitlesByTabId. Coverage ignores title values. Title keys can select a reusablepaneId, butpaneIdis not tested by the coverage Boolean.Most importantly, the production parent boundary prevents the oracle sequence.
Terminalexcludes activation-deferred IDs frombackgroundMountTabIds;TerminalPaneOverlayLayerapplies that mount filter before it checks the parked set. Therefore a false coverage verdict does not reveal or mount the deferredTerminalOverlaySlot, so the pane-mount title writer used by the test cannot run. A real reveal goes throughrevealActivationDeferredTabs, which adds the tab to the parent mount restriction and removes it from the deferred set in the same one-way transition.StrictMode may replay watcher setup and cleanup, and title writes may cause renders, but coverage does not read watcher ownership and its truth does not alternate. There is no commit-synchronous path from watcher start/dispose through these inputs back to park/reveal that can reach React error #185.
Why the prior oracle was invalid
The deleted storm test defined coverage as
!watcherEntries.has(tab.id). Production has no equivalent read. It also omitted the parentbackgroundMountTabIdsrestriction, so its always-available deferred slot mounted whenever the mocked verdict flipped. Mount/write counters were non-vacuous only because the always-mounted active tab could satisfy them; they did not prove a deferred pane crossed the real reveal owner.An investigative production-predicate probe kept coverage true across actual watcher registration, runtime-title slot changes, watcher disposal, and unmount capture. It was not retained because it documents the absence of the claimed bug rather than a product regression contract.
Final changes
origin/main.No crash fix remains, and this PR does not claim to resolve the field reports. Those reports need a fresh root-cause investigation from their actual breadcrumbs and teardown path.
Verification
All commands ran sequentially, one file at a time, with
--config config/vitest.config.ts --no-file-parallelism:terminal-parked-tab-watchers.test.tsuse-parked-terminal-watcher-synchronization.react185.test.tsxuse-terminal-tab-cold-parking.test.tsbackground-terminal-worktree-mount.test.tscheck-reliability-gates.test.mjsElectron QA was not run, per the final-readiness task. The branch has no net product diff to validate.
Scope and compatibility
Because the branch is restored to
origin/main, there is no change to output ownership, data retention, StrictMode behavior, split or legacy layouts, SSH/remote/folder workspaces, platform behavior, performance, wire compatibility, persistence, or mobile.Author