Skip to content

fix(sentry): bound desktop and daemon error volume (stable hotfix) - #8117

Merged
illegalcall merged 2 commits into
stablefrom
ao/sentry-errors/hotfix-stable
Nov 10, 2026
Merged

illegalcall merged 2 commits into
stablefrom
ao/sentry-errors/hotfix-stable

Conversation

@illegalcall

Copy link
Copy Markdown
Collaborator

What

Backports two Sentry volume fixes from main onto stable (v0.14.10, 033d597032), so they can ship as a stable patch without promoting the rest of main:

#7878 comes first because #8087 builds on it. On its own, #8087 conflicts on stable in the daemon sentryobs package and in sentry-main.ts. With #7878 applied first, both commits apply without conflicts.

Why

0.14.10 used up the Sentry quota in two days (details in #8087), so Sentry is dropping errors. Every 0.14.10 install sends every desktop and daemon error.

Before / After

Before (0.14.10) After
Every install sends every non-fatal desktop and daemon error One install in ten sends them; Electron main crashes and daemon panics still send from every install
Renderer budget in memory, keyed on the raw first stack line 3 per fingerprint and 25 per install per UTC day, saved in telemetry_sentry_budget.json in the data directory
Most renderer errors are titled Renderer Error in unknown (unknown) Titles name the bundle file and line, and events carry debug IDs for uploaded source maps
Self-built copies with release-like versions report to Sentry Only builds from build-artifacts.yml (AO_PUBLISHED_BUILD=1) with a stable or nightly version report

Testing

A PR into stable skips the Go and frontend test jobs: go.yml and frontend.yml run them only when base_ref == 'main'. So I ran them locally on ef67238ebf:

  • go build ./...: clean. go vet on the 7 touched packages: clean.
  • go test -count=1 on daemon, httpd, observe/sentryobs, observe/trackerintake, service/agent, service/chat and session_manager: all pass.
  • npm ci in frontend/ succeeds with the backported lockfile. npm run typecheck passes, with packages/product-ui installed the way CI installs it.
  • vitest on the 11 touched test files: 462 passed.
  • The added and removed lines of each cherry-pick match its main commit exactly. For fix(sentry): bound desktop error volume and give renderer errors real titles #8087 only the surrounding context lines differ.

Not done: the full vitest and Go suites, a packaged AO_PUBLISHED_BUILD=1 build, and a desktop smoke test.

Migrations

None in either commit.

Merging and release

Merge with a merge commit, as with #7383. Then the release conductor cuts the patch from the new stable head:

gh workflow run stable.yml --repo OrchestratorInc/ao-releases -f version=0.14.11 -f ref=<stable head after merge>

The build-artifacts.yml run publishes sentry-sourcemaps-<platform> artifacts, kept for 1 day. Upload all four to ao-electron with sentry-cli sourcemaps upload --org untrivial-x0 --project ao-electron <dir>. Until then, frames stay minified.

#8070 (promotion of main) also uses 0.14.11 and fast-forwards stable to 7e807beb01. After this merges, that push is no longer a fast-forward, so #8070 needs its -s ours merge of stable redone and its version changed to 0.14.12. #8070 already contains #7878 but not #8087.

Risks

  • Installs on 0.14.10 keep sending at full volume until they update. A rate limit on the Sentry client keys covers them in the meantime.
  • The daemon's per-install daily cap is in memory and resets when the daemon restarts.
  • A build made outside build-artifacts.yml sends nothing to Sentry. This is intended.

🤖 Generated with Claude Code

… titles (#8087)

* fix(sentry): sample daemon errors by install and cap them per day

Non-fatal daemon errors now send only from installs where
sha256(install_id) % 10 == 0, tagged sample_rate=0.1; panics always
send, tagged sample_rate=1. A per-install total of 25 errors per UTC day
sits on top of the per-fingerprint budget. Model discovery failures and
CODEX_ACCOUNT_SETUP_INCOMPLETE are user setup state and no longer reach
Sentry, and only published stable or nightly versions initialize it.

* fix(sentry): sample and budget desktop errors in Electron main

Electron main now samples non-fatal desktop errors by install (the
daemon's sha256(install_id) % 10 rule) and caps every event after
scrubbing on its final fingerprint: 3 per fingerprint and 25 in total per
install per UTC day, persisted to the AO data dir so reloads, new windows
and restarts keep the budget. Main-process crashes and uncaught
exceptions send from every install. The renderer's in-memory exception
budget is gone. Sentry initializes only for release-stamped stable or
nightly versions of a build marked AO_PUBLISHED_BUILD=1.

* fix(sentry): give renderer errors real titles and debug IDs

safeRendererFrames now keeps anonymous minified frames and named frames
whose function is not allowlisted, as renderer_frame with the validated
bundle location, so titles read 'Renderer TypeError in
assets/useSessionWorkspaceFiles:123:45' instead of 'unknown'. Chunk debug
IDs from the Sentry bundler plugin travel as debug_meta images, and main
bundle frames and images are rewritten to app:/// URLs so uploaded
source maps apply without sending install paths.

* build(sentry): emit debug-ID source maps for release builds

Release builds (AO_PUBLISHED_BUILD=1, set by build-artifacts.yml) now
emit hidden source maps for the Electron main and renderer bundles and
stamp them with Sentry debug IDs through @sentry/vite-plugin. Forge
leaves every .map out of the package. With SENTRY_AUTH_TOKEN the plugin
uploads to ao-electron itself; the secret-free artifact workflow instead
hands the maps to the release conductor as sentry-sourcemaps-* run
artifacts.

* docs(telemetry): document Sentry install sampling, daily caps and published-only builds

* fix(deps): restore the @pierre/theme lock entry pruned by npm 11

npm 11 dropped the optional peer entry when adding @sentry/vite-plugin;
CI's npm 10.9.8 then rejected the lock as out of sync with package.json.

* fix(sentry): keep a JS platform on scrubbed desktop events

The rebuilt events dropped the SDK's platform, so Relay defaulted it to
'other' and Sentry skipped JS symbolication, ignoring the debug IDs.
Renderer events are now 'javascript' and main events 'node'.

(cherry picked from commit 6554304)
@github-actions

Copy link
Copy Markdown
Contributor

🏆 Review leaderboard

Nov 3–10, 2026 · UTC

Rank Reviewer PRs reviewed Review rounds PR comments
🥇 @ronishrohan @ronishrohan 89 155 17
🥈 @illegalcall @illegalcall 13 15 5
🥉 @Meraj-08 @Meraj-08 12 19 0
4 @Rishet11 @Rishet11 8 10 4
5 @neversettle17-101 @neversettle17-101 7 8 4
6 @Prasad-D-Ware @Prasad-D-Ware 6 10 2
7 @nikhilachale @nikhilachale 5 29 4
8 @somewherelostt @somewherelostt 5 18 2
9 @Pritom14 @Pritom14 5 8 1
10 @mohakchakraborty2004 @mohakchakraborty2004 5 7 2

Ranked by distinct external PRs reviewed, then review rounds, then PR comments. Self-activity and bot activity are excluded.

Show 6 more reviewers
Rank Reviewer PRs reviewed Review rounds PR comments
11 @Annieeeee11 @Annieeeee11 5 6 1
12 @ApexYash11 @ApexYash11 3 4 2
13 @Vaibhaav-Tiwari @Vaibhaav-Tiwari 2 3 0
14 @harshitsinghbhandari @harshitsinghbhandari 2 2 0
15 @MohamedKamran @MohamedKamran 1 2 0
16 @codebanditssss @codebanditssss 1 1 0

@illegalcall
illegalcall merged commit fb3a5c1 into stable Nov 10, 2026
22 checks passed
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.

2 participants