fix(crash-reporting): persist no-capture crash diagnostics
Summary
- Add durable crash-reporting diagnostics for no-capture cases so an uncaptured manual report can explain whether a reportable process-gone event was suppressed, skipped because the crash-report store was unavailable, or lost to a persistence failure.
- Reuse the existing sanitized process-gone breadcrumb data and keep pending-report prompts, expected-teardown suppression, dedupe, and manual submit transport behavior unchanged.
Refs #7776.
Testing
- [ ]
pnpm lint - [ ]
pnpm typecheck - [ ]
pnpm test - [ ]
pnpm build - [x] Added or updated high-quality tests that would catch regressions, or explained why tests were not needed
Focused validation:
pnpm exec vitest run --config config/vitest.config.ts src/main/crash-reporting/process-gone-crash.test.ts src/main/crash-reporting/process-gone-diagnostics.test.ts src/main/crash-reporting/crash-report-store.test.ts- passed.pnpm run typecheck:node- passed.
AI Review Report
Two review passes checked the final diff. The first pass did not find issues. The second pass found that the initial tests covered the diagnostic helper but not the production recordProcessGoneCrash routing. The routing owner moved into src/main/crash-reporting/process-gone-crash.ts, with focused tests for store-unavailable, suppressed, deduped, persisted, persist-failed, and non-report branches. The rerun reported no findings and verified the fixed class and ENUM coverage.
The review covered macOS, Linux, and Windows compatibility for main-process crash diagnostics, Electron process-gone handling, diagnostic bundle visibility, pending-report preservation, and the unchanged manual submit path.
Security Audit
No new IPC, subprocess, network endpoint, auth, SSH, dependency, or renderer surface was added. Error names and messages sent to durable no-capture spans go through the existing crash-reporting sanitizer, and tests cover path-like text, token-like text, and secret-like text redaction. Raw error objects and stacks are not written to span attributes.
Notes
No visual change.
This is a partial fix for the no-capture diagnostic slice of #7776. It intentionally does not change manual crash-report upload transport, retry behavior, timeout handling, fallback hosts, or renderer toast text.
📝 Walkthrough
Walkthrough
A new process-gone-crash.ts module is added, exporting RecordProcessGoneCrashRuntime and recordProcessGoneCrash, which handles reason validation, store-unavailable checks, suppression, deduplication, span-based tracing, and crash-report persistence with failure handling. process-gone-diagnostics.ts gains a "no-capture" diagnostic surface (ProcessGoneNoCaptureDiagnosticName, buildProcessGoneNoCaptureDiagnosticAttributes, recordProcessGoneNoCaptureDiagnostic) with sanitized error attributes and span-based recording. src/main/index.ts removes its inline crash-handling logic and startSpan import, instead importing the new module and adding a recordProcessGoneCrashFromMain wrapper used by the renderer and child-process-gone handlers. Corresponding test suites are added/extended for both new modules.
🚥 Pre-merge checks | ✅ 3 | ❌ 2
❌ Failed checks (2 warnings)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Docstring Coverage | ⚠️ Warning | Docstring coverage is 9.09% which is insufficient. The required threshold is 80.00%. | Write docstrings for the functions missing them to satisfy the coverage threshold. |
| Description check | ⚠️ Warning | The description is detailed but does not follow the required template; it omits Summary, Screenshots, Testing checklist, AI Review Report, Security Audit, and Notes. | Rewrite the PR description to use the template headings and add the missing testing, AI review, security audit, screenshots/no visual change, and notes sections. |
✅ Passed checks (3 passed)
| Check name | Status | Explanation |
|---|---|---|
| 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 summarizes the main change: persisting no-capture crash diagnostics. |
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 @coderabbitai help to get the list of available commands.
Closing as superseded by #8242, now merged. That PR includes durable no-capture breadcrumbs and unified process-gone classification, and also fixes the startup read/write race plus Windows ACL/transient-file failures that could prevent a pending report from being observed or persisted. Thanks for the investigation and focused tests here.