feat(crash): capture Go panics, breadcrumbs, and group summaries#4187
Merged
Conversation
The crash dashboard only ever saw frontend WebView errors, every group was an opaque count=1 fingerprint, and minified stacks carried no symbols. This widens what a report captures and makes the dashboard triageable. - desktop: capture Go-side panics on the goroutines we own (restore/build/ snapshot), persist a scrubbed stack to crash-pending.json, and resend on next launch under the desktop.telemetry opt-out. recoverToPending re-raises so the process still crashes — the stack is recorded, not swallowed. - worker: store a one-line title per group and surface it in the dashboard list so a crash is readable without opening each fingerprint. - frontend: a breadcrumb ring buffer (console.error/warn, tab navigation) folded into the report. Keep console.warn/error in production — terser drop_console was deleting the very trail the breadcrumbs collect. - frontend: preserve function/class names through terser and stamp the build commit, normalized in the worker fingerprint so grouping stays build-stable.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The desktop crash dashboard only ever saw frontend WebView errors. The entire
Go agent/provider/tool layer was invisible: an unrecovered panic kills the
process before the click-to-send overlay can paint, so it never produced a
single report. On top of that every group was an opaque
count=1fingerprintand minified stacks carried no symbols, so nothing was triageable without
opening each one.
What changed
Go panic capture + deferred resend (
desktop/crash_pending.go). ArecoverToPending(site)guard on the goroutines we own (restore / buildcontroller / snapshot loop) writes a path-scrubbed stack to
crash-pending.jsonand re-raises, so the process still crashes — thestack is recorded, not swallowed.
flushPendingCrashdrains and POSTs it onthe next launch, gated on the same
desktop.telemetryopt-out as the launchping (dev builds and opt-out drop it unsent). Wails-managed bound-call
goroutines are not yet wrapped — a known follow-up.
Dashboard group summaries (worker). Each group now stores a one-line
title, shown as asummarycolumn in the list so a crash reads at a glanceinstead of requiring a click per fingerprint.
Frontend breadcrumbs (
breadcrumbs.ts). A 30-entry ring buffer(
console.error/warn, tab navigation) folded into the report and scrubbedby the existing Go path scrubber. Terser's
drop_console: truewas deletingthe very
console.*calls the breadcrumbs collect, so production builds nowkeep
warn/errorand drop only the noise.Readable stacks + build identity (
vite.config.ts).keep_fnames/keep_classnamespreserve real function/component names throughminification, and the build commit is stamped into each report. The worker
fingerprint normalizes the
build <sha>token so grouping stays stableacross builds.
Deploy notes (worker)
groups.titleis a new column. Run the one-time migration before deployingthe worker, or the new queries hit a missing column:
Fresh installs get the column from
schema.sql.Verification
desktop:go vetclean; newcrash_pending_test.gocovers capture +re-raise, path scrubbing, size cap, send-and-clear, and the dev guard.
workers/crash-report:tsc --noEmitclean.