Skip to content

Report errors users hit to Sentry from the app and server - #1455

Merged
dylanplayer merged 1 commit into
mainfrom
codevisor/telemetry-errors
Nov 22, 2026
Merged

dylanplayer merged 1 commit into
mainfrom
codevisor/telemetry-errors

Conversation

@dylanplayer

Copy link
Copy Markdown
Member

Why

New users arrive tomorrow, and we can't see when Codevisor fails for them. Most failures happen in the server (turns, worktrees, git, first-run answers), which had no error reporting. The app's Sentry filter also dropped every error message.

What changes

  • Server → Sentry: uncaught exceptions and unhandled rejections, unexpected API 500s (tagged with the route shape), and harness turn failures (tagged with harness and stop kind, grouped by message). It uses a small envelope sender with no dependency; @sentry/node would add about 40 OpenTelemetry packages to the runtime. Reports are rate limited (each distinct failure once per 10 minutes, at most 20 per window).
  • App → Sentry: every error banner and every message that fails to deliver, with a scrubbed description, error type, and stack.
  • Scrubbing on both sides: file paths, emails, the computer account name, and tokens and keys.
  • Privacy toggles sync across the account through the settings namespace, so servers honor them. An opt-out made before syncing outranks earlier opt-ins. Servers that never received a choice report nothing.
  • Every PostHog event and Sentry report carries update_channel, feature_flags, and flag_<id>, read from the synced flags. New flags need no telemetry code, and internal traffic can be filtered with flag_developerMode.

Needs sign-off

apps/www/src/routes/privacy.tsx: the policy still said analytics and crash reports are off by default, which hasn't been true since #1419. It also said exception messages are removed. Both sections are updated. The effective date (Oct 30) is unchanged; bump it if you want.

Verified

  • Swift: scrubber, privacy sync, sanitizer, and analytics suites pass. The macOS app builds.
  • Server: all 2,261 tests pass with coverage; the new diagnostics module is at 96% of lines.
  • In the dev app: turning "Send crash and error reports" off and on in Settings shows up on the dev server's synced settings (false, then true, with real timestamps). The new footer text shows.
  • One development-tagged envelope sent to Sentry returned 200 (e39b9f72…), with the path in its message scrubbed to <path>.

🤖 Generated with Claude Code

…h every enabled feature flag

- The Codevisor server now reports uncaught exceptions, unhandled rejections,
  unexpected API failures, and harness turn failures to Sentry through a small
  dependency-free envelope sender. Messages are scrubbed of paths, emails, the
  account name, and credentials; reports are rate limited and grouped.
- The macOS app reports every error banner and every message that fails to
  deliver, with a scrubbed description, error type, and stack trace. The
  privacy filter keeps scrubbed messages instead of dropping them.
- "Share usage analytics" and "Send crash and error reports" sync across the
  account through the settings namespace, so servers can honor the choice. An
  opt-out made before syncing outranks earlier opt-ins.
- PostHog events and Sentry reports carry the update channel and every
  enabled feature flag (feature_flags plus flag_<id>), read from the synced
  flags so new flags need no telemetry code.
- Privacy policy and the Settings footer describe the new behavior.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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