Repository navigation
feat(terminal): breadcrumb the worktree parking pass verdicts and manager census - #14660
brennanb2025 wants to merge 3 commits into
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. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (5)
Included review availability: Your plan includes up to 10 reviews per rolling hour; 5 remain after this review. 📝 WalkthroughWalkthroughThe renderer now summarizes terminal worktree parking decisions, queues telemetry until pane unmounts are committed, samples live pane census data, and suppresses unchanged summaries. Cleanup cancels pending telemetry. The main process coalesces 🚥 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: 1
🧹 Nitpick comments (1)
src/renderer/src/components/terminal-pane/terminal-worktree-parking-telemetry.ts (1)
1-10: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueShorten the module comment.
Keep the non-obvious reason. Remove the implementation walkthrough.
As per coding guidelines: “Comments must be concise, non-obvious, and brief—prefer one line; do not explain obvious behavior or walk through code.”
Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 6529e964-55be-4f35-90a1-94b9c2a3cad6
📥 Commits
Reviewing files that changed from the base of the PR and between 8b31910 and 93d1e213800420717dbb220335e2a61a0af77157.
📒 Files selected for processing (7)
src/main/crash-reporting/crash-breadcrumb-store.test.tssrc/main/crash-reporting/crash-breadcrumb-store.tssrc/main/ipc/crash-reporting-renderer-breadcrumbs.test.tssrc/main/ipc/crash-reporting.tssrc/renderer/src/components/Terminal.tsxsrc/renderer/src/components/terminal-pane/terminal-worktree-parking-telemetry.test.tssrc/renderer/src/components/terminal-pane/terminal-worktree-parking-telemetry.ts
9f1eb02 to
faa64e4
Compare
Electron QA evidence (
|
5d1a389 to
25c7dbd
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/renderer/src/components/terminal-pane/terminal-worktree-parking-telemetry.test.ts (1)
134-159: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winTest replacement before the queued flush.
The test flushes the first sample before it queues the second sample. It does not cover the
flushTimer !== nullpath, wherequeueTerminalWorktreeParkingPassmust replace the pending summary. Add two queue calls before advancing timers. Assert that one breadcrumb contains the second sample.Proposed regression test
+ it('keeps the latest sample before the queued flush', () => { + queueTerminalWorktreeParkingPass({ + verdicts: [verdict({ worktreeId: 'a', hiddenSinceMs: 0 })], + ordinaryParkedCount: 0, + parkingEnabled: true, + retentionBudgetEnabled: true, + nowMs: 60_000 + }) + queueTerminalWorktreeParkingPass({ + verdicts: [ + verdict({ + worktreeId: 'a', + hiddenSinceMs: 0, + hasPendingSpawnWork: true + }) + ], + ordinaryParkedCount: 0, + parkingEnabled: true, + retentionBudgetEnabled: true, + nowMs: 61_000 + }) + + vi.runOnlyPendingTimers() + + expect(harness.crumbs).toHaveLength(1) + expect(harness.crumbs[0]?.data?.sampledAtMs).toBe(61_000) + expect(harness.crumbs[0]?.data?.pastParkDelayPendingSpawnWork).toBe(1) + })
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: bde614d5-5456-449d-99a5-226aef433362
📥 Commits
Reviewing files that changed from the base of the PR and between c066a55 and 25c7dbd93a8d088e250c15c711e9c4263007424d.
📒 Files selected for processing (7)
src/main/crash-reporting/crash-breadcrumb-store.test.tssrc/main/crash-reporting/crash-breadcrumb-store.tssrc/main/ipc/crash-reporting-renderer-breadcrumbs.test.tssrc/main/ipc/crash-reporting-renderer-breadcrumbs.tssrc/renderer/src/components/Terminal.tsxsrc/renderer/src/components/terminal-pane/terminal-worktree-parking-telemetry.test.tssrc/renderer/src/components/terminal-pane/terminal-worktree-parking-telemetry.ts
🚧 Files skipped from review as they are similar to previous changes (4)
- src/main/crash-reporting/crash-breadcrumb-store.ts
- src/main/ipc/crash-reporting-renderer-breadcrumbs.test.ts
- src/renderer/src/components/Terminal.tsx
- src/renderer/src/components/terminal-pane/terminal-worktree-parking-telemetry.ts
Included review availability: Your plan includes up to 10 reviews per rolling hour; 6 remain after this review.
25c7dbd to
5f39dc0
Compare
e344605 to
65303bc
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
…ager census The parking pass computes a per-worktree verdict on every run and, outside e2e, throws it away — so when a field session mounts 49 managers with the park/retention system idle, the bundle cannot say WHY: a hiddenSince clock that keeps resetting under worktree cycling is indistinguishable from a decision-time veto (pending spawn work, cooldown, coverage, measure, portal). Record a change-damped terminal_parking_pass breadcrumb per verdict shift: deadline-cohort counts (hidden past the 30s park delay / 5min hot-retain / 15min retention TTL — a resetting clock keeps all three at zero), the veto counts, ordinary/force park results, and the live manager+pane census the same bundles used to infer from crumb multiplicity. Keyed on the counts, never on raw ages, with a 30s emission floor, so steady state emits nothing. No worktree ids in the payload (ids embed paths). With this, the next bundle showing unbounded mounted managers answers clock-reset vs veto directly instead of a fourth investigation.
65303bc to
62808d2
Compare
|
Closing this — the question it was built to answer has since been answered, and the answer is negative. Why it was openedThis PR was instrumentation only, deliberately split out from the fix (#14653) so the two could be judged separately. It never claimed to fix a crash. A cluster of React #185 crashes at boundary
That last point was the actual motivation: the existing breadcrumbs only fired when damping engaged, so the case we cared about was precisely the one that left no trace. This PR breadcrumbed every parking-pass verdict plus a manager census so the next field bundle could answer whether verdicts churn in production. Why it can be closed1. The field data answered it without this instrumentation. Across the crash corpus, park churn appears in 0 of 16 React #185 reports versus 3 of 336 non-#185 reports — not merely absent but anti-correlated. The one report that did show heavy churn ( 2. The fix this was paired with was disproved. #14653 closed at zero diff on two independent grounds: its reproduction mocked pane coverage as "no watcher entry exists for this tab", but 3. The cluster was mis-scoped. React #185 is not a terminal parking bug. The 16 reports span five boundaries — 4. Most of the cluster was already fixed. 12 of 16 reports map onto six shipped fixes ( 5. It cannot address the one cluster still open. The renderer memory leak is untracked heap; this PR emits manager and pane counts. Count-based instrumentation is the same instrument class that has already returned clean on this leak repeatedly. Follow-up#14867 shipped a retained singleton breadcrumb slot for |




ELI5
Orca already decides on every terminal parking pass whether hidden worktrees are old enough to unload and which rule, if any, vetoes that decision. Production currently throws that explanation away, so a crash bundle with many live terminal managers cannot distinguish a clock that keeps resetting from an aged worktree that is repeatedly vetoed.
This PR records one compact latest-state census: hidden-worktree age cohorts, veto counts for the cohort already past the parking delay, the global parking/retention gates, ordinary/forced parking outcomes, and the post-commit live manager/pane counts. It changes no parking verdict or mount behavior.
What Changed
terminal_parking_pass.This branch intentionally does not change
crash-breadcrumb-storeretention policy.Why
This is instrumentation, not a crash fix. The next field bundle can distinguish:
hiddenTrackedremains high while the 30-second, 5-minute, and 15-minute cohorts remain near zero.The payload contains aggregate counts only; worktree IDs are excluded because they embed paths.
Durability
The retained-slot policy landed independently in #14867 and is now part of
main. This PR uses that existing durability behavior but does not change its budget or retention rules.The telemetry remains logically independent: emission and coalescing produce valid census data, while the already-landed store policy determines how long it survives unrelated ring pressure.
Trade-offs
Visual Proof
N/A — this adds crash-reporting instrumentation and changes no rendered UI or interaction.
Testing
All #14660 targeted tests pass after rebasing onto current
origin/main(7 files, 95/95 tests):terminal-worktree-parking-telemetry.test.tscrash-reporting-renderer-breadcrumbs.test.tsactive-terminal-repair-loop.react185.test.tsxuse-terminal-tab-cold-parking.test.tsterminal-cold-park-verdict-loop.test.tsxforce-park-buffer-capture.test.tsterminal-hidden-view-parking.test.tsCurrent
origin/mainincludes the independently landed retention and coalescing changes; the counts above are from this rebased PR head.Compatibility and Scope
Linked Issue
No tracked GitHub issue exists for this work. It comes from the 2026-08-13/14 crash-field sweep and instruments the open question behind a renderer-memory investigation.
Checklist
Author