Skip to content

Crash reporting: a local log + Copy diagnostics (#138) - #420

Merged
Nabzx merged 3 commits into
mainfrom
crash-log-diagnostics-138
Sep 21, 2026
Merged

Nabzx merged 3 commits into
mainfrom
crash-log-diagnostics-138

Conversation

@Nabzx

@Nabzx Nabzx commented Sep 21, 2026

Copy link
Copy Markdown
Owner

Closes #138. A local, capped crash log and a "Copy diagnostics" action in Settings - not a telemetry service, per the issue's own preference.

Scope, decided before building

  • Main-process crashes only - uncaught exceptions and unhandled promise rejections in the Electron main process. Not renderer crashes, not extending crash-loop visibility to the other native helpers beyond what modelSupervisor already does for the model servers (Surface model-server and transcription failures to the user #254).
  • Passive access only - a Settings "Copy diagnostics" button. No proactive post-crash prompt on next launch.

What's built

  • crashLogStore.js: a capped (20) local JSON log, same persistence shape as settingsStore.js but with a synchronous record() - it's called from inside an uncaughtException handler, where the process may be moments from exiting, so there's no Promise chain that might not finish in time.
  • Wired into main.js's existing handlers, not new ones. main.js already had uncaughtException/unhandledRejection handling from Crash on window close and on tray Open Window (Object has been destroyed) #294/Fix window-close crash and finish the overlay panel border #295 - deliberately not force-exiting the process (an error dialog for a real problem, silence during shutdown). This PR only adds a write to disk alongside what already happens; that established behaviour is otherwise untouched.
  • Settings → Diagnostics: app/OS/Electron versions plus the crash log, formatted as plain text, copied to the clipboard on demand. A "Clear crash log" action shows once there's something to clear.

Tests

crashLogStore.test.js (10 - defaults, capping, persistence, the synchronous contract explicitly asserted). Full suite (417) + typecheck + build green. main.js's own wiring is untested directly, consistent with this codebase's convention (it's thin glue over tested modules).

🤖 Generated with Claude Code

Uncaught exceptions and unhandled promise rejections, kept as a
capped (20) JSON file - never sent anywhere. record() is deliberately
synchronous, unlike settingsStore.js's shape: it gets called from
inside an uncaughtException handler, where the process may be moments
from exiting, so there's no Promise chain that might not finish.

Claude-Session: https://claude.ai/code/session_0144sxo5CJiyk99vaR7sgjuj
main.js already had uncaughtException/unhandledRejection handlers from
#294/#295 - deliberately not force-exiting the process (a dialog for a
real error, silence during shutdown). Added crash-log recording inside
those existing handlers rather than introducing new ones, so nothing
about that established behaviour changes - this only adds a write to
disk alongside what already happens.

The store itself is lazily constructed on first crash (app.getPath()
is never called at module load, only if a crash actually occurs).

IPC: app:get-diagnostics (app/OS/Electron versions + the crash log,
raw data - the renderer formats it), app:copy-diagnostics,
app:clear-crash-log.

Claude-Session: https://claude.ai/code/session_0144sxo5CJiyk99vaR7sgjuj
App/OS/Electron versions plus the crash log, formatted as plain text
and copied to the clipboard on demand - ready to paste into a bug
report. Passive only, per the scoping call: nothing surfaces
proactively after a crash, the user has to come looking. A Clear
crash log action shows once there's something to clear.

Claude-Session: https://claude.ai/code/session_0144sxo5CJiyk99vaR7sgjuj
@Nabzx
Nabzx merged commit 6360ac6 into main Sep 21, 2026
1 check passed
@Nabzx
Nabzx deleted the crash-log-diagnostics-138 branch September 21, 2026 10:48
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.

Crash reporting

1 participant