Skip to content

Desktop crash reporting + diagnostics export#961

Merged
RhysSullivan merged 7 commits into
mainfrom
claude/epic-meitner-145193
Jun 12, 2026
Merged

Desktop crash reporting + diagnostics export#961
RhysSullivan merged 7 commits into
mainfrom
claude/epic-meitner-145193

Conversation

@RhysSullivan

@RhysSullivan RhysSullivan commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Crash reporting for the desktop app (Sentry, gated on a build-time DSN — local/dev builds send nothing), with DO_NOT_TRACK honored as the opt-out.

  • Main, renderer, and sidecar processes all report errors, tagged with a shared per-launch run id; electron-log lines ride along as breadcrumbs
  • Sidecar stdout/stderr now persist to the log file (previously terminal-only)
  • Export Diagnostics (menu + Settings page): logs, crash dumps, and a redacted manifest zipped to Downloads — never secrets or executor data
  • Report a Problem… menu item: diagnostics zip + prefilled GitHub issue
  • New in-window crash screen when the local server dies: restart, check for updates (a recurring crash may already be fixed upstream), export diagnostics
  • New desktop e2e target driving the real Electron app (Playwright)

The crash → restart flow, recorded by the e2e scenario:

Desktop · sidecar crash shows the recovery screen and restart heals it (desktop)

- Sentry in the Electron main process, gated on a DSN baked in at build
  time (SENTRY_DSN env -> define). No DSN (local/dev/fork builds) means
  nothing is ever sent; native crash dumps are still written locally via
  crashReporter for the diagnostics export.
- Sidecar stdout/stderr now persist to main.log under a 'sidecar' scope
  (previously terminal-only, so server crashes left no trace on disk).
  Unexpected sidecar exits after a successful boot are logged and
  reported with a bounded stderr tail.
- render-process-gone / child-process-gone are logged locally and
  captured upstream; main-process uncaught errors land in main.log.
- Export Diagnostics: app menu item + Settings-page button pack a
  redacted manifest (version, OS, paths, port - never passwords or
  ~/.executor data), recent logs, and crash dumps into a zip in
  Downloads and reveal it in the file manager.
- publish-desktop.yml passes vars.SENTRY_DSN into the electron-vite
  build step.
…Problem

- Renderer: the shared web bundle initializes browser error reporting
  only when the desktop preload bridge hands it a DSN at runtime —
  nothing is baked into the bundle, so executor web / self-host / cloud
  stay inert. Handled UI errors already route through reportError and
  are picked up by the global handlers.
- Sidecar: env-gated init in the sidecar entry (DSN passed by the main
  process, desktop-with-DSN builds only). Captures uncaught exceptions
  and unhandled rejections in the server process. The CLI never sets
  the env vars, keeping executor web telemetry-free.
- One runId per launch tags events from all three processes and is
  stamped into the diagnostics-zip manifest, so a user-sent zip and its
  Sentry events can be cross-referenced.
- electron-log lines become Sentry breadcrumbs (file transport hook),
  so events arrive with recent log context.
- 'Report a Problem…' menu item exports the diagnostics zip and opens
  a prefilled GitHub issue (version, OS, runId).

Verified against a local fake ingest server: session/event envelopes
received from all three SDKs (browser on boot, electron on forced
sidecar SIGKILL with breadcrumbs attached, bun on forced bind failure).
Compiled-sidecar smoke test passes with @sentry/bun bundled.
- DO_NOT_TRACK=1 (or true) disables crash reporting in all three
  processes — checked once in the main process, which is the single
  source of the renderer's and sidecar's reporting config.
- When the sidecar dies under a live window the app now swaps the dead
  web UI for an in-window crash screen (data: URL, preload bridge
  intact) with Restart server / Export diagnostics actions. Restart
  drives the existing sidecar restart IPC and reloads the console.
- New e2e desktop target + scenario: launches the real Electron app in
  a throwaway HOME via Playwright's electron driver, SIGKILLs the
  sidecar, asserts the crash screen, recovers via its Restart button,
  and asserts the healed sidecar is a new pid. Produces session.mp4 +
  per-step screenshots under e2e/runs/desktop/. Run with
  `npm run test:desktop` in e2e/ (needs a display).
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 11, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
executor-marketing 303c8dc Commit Preview URL

Branch Preview URL
Jun 12 2026, 12:21 AM

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 11, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
executor-cloud 303c8dc Jun 12 2026, 12:22 AM

Repo-level SENTRY_DSN was ambiguous next to cloud's own Sentry config;
the variable now names its surface.
A recurring sidecar crash may already be fixed upstream — the crash
screen gets a Check for updates button (reuses the menu update flow),
and showing the screen quietly stages any available update so the
install prompt appears on its own, mirroring the fatal-startup
self-heal.
@RhysSullivan RhysSullivan marked this pull request as ready for review June 12, 2026 00:21
@RhysSullivan RhysSullivan merged commit e3c49ef into main Jun 12, 2026
9 of 12 checks passed
@RhysSullivan RhysSullivan deleted the claude/epic-meitner-145193 branch June 12, 2026 00:25
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