Skip to content

fix(crash-reporting): give the parking census a retained breadcrumb slot without starving memory highwaters - #14867

Merged
brennanb2025 merged 2 commits into
mainfrom
brennanb2025/crash-breadcrumb-retention-slot
Aug 16, 2026
Merged

brennanb2025 merged 2 commits into
mainfrom
brennanb2025/crash-breadcrumb-retention-slot

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Aug 16, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​77 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​77
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​16 $\color{#cf222e}{\Huge{\mathbf{−}}}$​2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​14

ELI5

Crash reports carry a short list of recent breadcrumbs plus a few "keep this one no matter
what" slots. Those keep-forever slots were all spoken for by memory-highwater records, so a
newly added parking-census breadcrumb kept getting pushed out of the report before anyone
could read it. This adds one named keep-forever slot for it, and caps the memory ones
separately so the two kinds can't starve each other.

What Changed

src/main/crash-reporting/crash-breadcrumb-store.ts only:

  • MAX_RETAINED_BREADCRUMBS 4 → 5.
  • New MAX_RETAINED_MEMORY_BREADCRUMBS = 4, so memory-highwater retention is capped
    independently of the total.
  • retainedBreadcrumbKey grants a retained slot to the named parking-census crumb.

Why

Split out of #14660 at its reviewer's recommendation, and at the repo owner's direction.

#14660 is instrumentation-only — it adds a parking-pass telemetry breadcrumb and claims no
product behaviour change. But guaranteeing that crumb survives to the bundle cannot be
achieved by ordinary ring coalescing; it needs a retained slot. Changing shared retention is
policy that every breadcrumb producer in the app is subject to, and it has a user-visible
consequence, so it does not belong inside a terminal-telemetry PR where reverting the
telemetry would silently revert the retention policy too.

Five is the minimal budget: it preserves all four existing memory slots and adds exactly
one named singleton slot. Nothing else moves.

Trade-offs

  • User-visible consequence, stated plainly: every crash report now carries one fewer
    ordinary recent breadcrumb.
    The recent-ring slice shrinks by one to fund the retained
    slot. This affects all crash reports, not just terminal ones.
  • The retained key is a named singleton rather than a general mechanism. That is deliberate —
    a general allowlist would be over-abstraction for one caller — but it means the next
    producer wanting a retained slot must touch this file again.
  • Starvation was the obvious risk and is disproved by test, not by argument (below).

Linked Issue

No tracked issue. This is carved out of #14660, which came from the #orca-crashes sweep of
2026-08-14. #14660 depends on this landing — a durability improvement, not a correctness
gate: without it the telemetry still functions and coalesces, but its census crumb is
evictable under ring pressure.

Visual Proof

N/A — main-process breadcrumb retention policy, no UI surface.

Testing

AI Disclosure

Adversarial Review

Carved out of #14660 during that PR's merge-gate review. The retention change was found by
that review (the census crumb was being evicted — "trailing-state loss"), and the same
reviewer then recommended it be split rather than shipped inline. It has not had an
independent adversarial loop of its own as a standalone PR; treat it as needing one.

Review

  • Security: no new data captured; a retained slot holds a crumb the app already records.
  • Cross-platform: main-process only, no platform-conditional paths.
  • Remote/SSH, mobile: unaffected.
  • Backwards compatibility: additive retention policy; no schema or wire change.
  • Performance: one extra retained entry; the added filter runs only on retained writes.

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
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass — focused suites and
    the materialized merge pass; full lint/test/build left to CI.

Author

  • X / Twitter: @BrennanKB5

@coderabbitai

coderabbitai Bot commented Aug 16, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 410c2ea1-8d30-4d36-a311-3ec6d36059e1

📥 Commits

Reviewing files that changed from the base of the PR and between caa629e6491e5a0b7bab046806fa07d548788c25 and 5b3951f.

📒 Files selected for processing (1)
  • src/main/crash-reporting/crash-breadcrumb-store.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/main/crash-reporting/crash-breadcrumb-store.test.ts

Included review availability: Your plan includes up to 10 reviews per rolling hour; 4 remain after this review.


📝 Walkthrough

Walkthrough

The breadcrumb store now retains five entries: one terminal_parking_pass singleton and four renderer memory highwater entries. It preserves the parking breadcrumb by name and evicts only excess renderer memory entries. Tests cover parking census replacement, suppression counts, later activity, and retention across multiple surfaces.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Title check ✅ Passed The title clearly identifies the crash-reporting retention change and its purpose of preserving parking census data without starving memory highwaters.
Description check ✅ Passed The description is detailed and covers the required sections, testing, trade-offs, and review considerations; it references the related issue #14660.
✨ Finishing Touches
📝 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.

@brennanb2025
brennanb2025 force-pushed the brennanb2025/crash-breadcrumb-retention-slot branch from caa629e to 5b3951f Compare August 16, 2026 08:52
@brennanb2025
brennanb2025 force-pushed the brennanb2025/crash-breadcrumb-retention-slot branch from 5b3951f to fe7bf30 Compare August 16, 2026 09:00
@brennanb2025
brennanb2025 merged commit 28c93da into main Aug 16, 2026
45 checks passed
AmethystLiang pushed a commit that referenced this pull request Aug 17, 2026
…lot without starving memory highwaters (#14867)

* fix(crash-reporting): give the parking census a retained breadcrumb slot without starving memory highwaters

* test(crash-reporting): pin retained slot starvation
brennanb2025 added a commit that referenced this pull request Aug 17, 2026
…dcrumb slot without starving memory highwaters (#14867)" (#15005)

This reverts commit 28c93da.
paidaxingyo666 pushed a commit to paidaxingyo666/Manta that referenced this pull request Aug 21, 2026
…dcrumb slot without starving memory highwaters (stablyai#14867)" (stablyai#15005)

This reverts commit 28c93da.
AmethystLiang pushed a commit that referenced this pull request Aug 25, 2026
…lot without starving memory highwaters (#14867)

* fix(crash-reporting): give the parking census a retained breadcrumb slot without starving memory highwaters

* test(crash-reporting): pin retained slot starvation
AmethystLiang pushed a commit that referenced this pull request Aug 25, 2026
…dcrumb slot without starving memory highwaters (#14867)" (#15005)

This reverts commit 28c93da.
AmethystLiang pushed a commit that referenced this pull request Aug 25, 2026
…lot without starving memory highwaters (#14867)

* fix(crash-reporting): give the parking census a retained breadcrumb slot without starving memory highwaters

* test(crash-reporting): pin retained slot starvation
AmethystLiang pushed a commit that referenced this pull request Aug 25, 2026
…dcrumb slot without starving memory highwaters (#14867)" (#15005)

This reverts commit 28c93da.
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…lot without starving memory highwaters (stablyai#14867)

* fix(crash-reporting): give the parking census a retained breadcrumb slot without starving memory highwaters

* test(crash-reporting): pin retained slot starvation
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…dcrumb slot without starving memory highwaters (stablyai#14867)" (stablyai#15005)

This reverts commit f0d167c.
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.

1 participant