Skip to content

fix(radio): Preserve mode-lifecycle error causes for Sentry - #473

Merged
fcastrovilli merged 1 commit into
mainfrom
cursor/radio-26-mode-lifecycle-errors-4d16
Nov 7, 2026
Merged

fcastrovilli merged 1 commit into
mainfrom
cursor/radio-26-mode-lifecycle-errors-4d16

Conversation

@fcastrovilli

@fcastrovilli fcastrovilli commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Diagnostic fix for RADIO-26 (operation=loadModeLifecycle, generic AppError / UNEXPECTED_ERROR, no mode tag, empty breadcrumbs, radio@0.7.2, Firefox desktop, 2026-10-30).

This does not claim to resolve the original production failure. The captured event lost the underlying rejection, so the incident cause remains unknown. This PR only makes the same failure shape diagnosable next time and locks in regression coverage.

What RADIO-26 shows

  • Stack is the Radios effect catch around dynamic mode-lifecycle-requests import + synchronizeMode, then captureError → toAppError → AppError.
  • Tags: operation=loadModeLifecycle, surface=ui, no mode tag → import-failure path, not synchronizeMode’s reportFailure (which always tags mode).
  • Reported value is the generic safe message, so the original rejection was not an Error (or was already a cause-less AppError); captureError only forwarded cause instanceof Error to Sentry.

What is reproducible today

Path Behavior before After
Non-Error rejection into captureError Sentry gets only generic AppError Promoted NonErrorRejection Error with safe summary + original on cause
Lifecycle module load failure loadModeLifecycle without mode Same operation, mode tagged
Synthetic synchronizeMode activation rejection Already owned by synchronizeMode + mode Unchanged (regression proves ownership)

No functional playback/orchestration bug was demonstrated from the single production event; stream/provider issues are out of scope.

Red → green

Red (before implementation):

  • reporting policy > reports a non-Error rejection as a reportable Error that keeps the cause
  • reporting policy > does not put object rejection bodies into the reportable Error message
  • runModeLifecycleSynchronization > tags mode when the lifecycle module fails to load
  • (pass already) synthetic synchronizeMode rejection keeps operation=synchronizeMode

Green after the changes: those three + full suites below.

Changed files

  • packages/error/src/index.ts — promote non-Error causes for Sentry without JSON-serializing objects
  • packages/error/src/index.test.ts — RADIO-26-shaped capture regressions
  • apps/radio/src/lib/mode-lifecycle-boot.ts — extract load+sync with mode-tagged import failures
  • apps/radio/src/lib/mode-lifecycle-boot.test.ts — import vs synchronizeMode ownership
  • apps/radio/src/components/radio/index.tsx — use the boot helper

Validation

  • bun run check
  • bun run typecheck
  • bun run --filter @avoid.quest/error test
  • bun test packages/error/src/index.test.ts apps/radio/src/lib/mode-lifecycle-boot.test.ts apps/radio/src/lib/mode-lifecycle-requests.test.ts

Not verified: reproducing the exact Firefox 0.7.2 production rejection value (unavailable from the event).

Base: 7f7ed3bf52672df71a5514591af0b3a866708d0b

Not using Fixes RADIO-26 — observability only; original incident unexplained.

Open in Web Open in Cursor 

Summary by cubic

Makes mode-lifecycle load failures diagnosable in Sentry by preserving non-Error rejection causes and tagging the mode on import failures, without claiming to fix the original production incident (RADIO-26).

  • Non-Error rejections are promoted to a NonErrorRejection Error for reporting, keeping the original value on cause; object bodies are summarized as "Object" to avoid leaking private data.
  • loadModeLifecycle errors now carry a mode tag; synchronizeMode keeps ownership of its own failure reporting.

Written for commit 3140214. Summary will update on new commits.

View guided diff Turn on auto-fix

Mode-lifecycle module load failures with non-Error rejections were reported
only as a generic AppError, hiding the original cause (RADIO-26 shape), and
omitted the mode tag. Promote non-Error rejections for reporting, tag mode on
loadModeLifecycle, and cover synthetic synchronizeMode rejection ownership.

The Oct 30 production root cause remains unexplained; this is diagnostic only.

Reference: https://avoidquest.sentry.io/issues/RADIO-26

Changelog: skip
Co-authored-by: Francesco Castrovilli <fcastrovilli@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Nov 7, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 58 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 500a7ed8-be81-4084-95b8-4f890259de1b
Commits

Reviewing files that changed from the base of the PR and between 7f7ed3b and 3140214.

Files selected for processing: 5

  • apps/radio/src/components/radio/index.tsx
  • apps/radio/src/lib/mode-lifecycle-boot.test.ts
  • apps/radio/src/lib/mode-lifecycle-boot.ts
  • packages/error/src/index.test.ts
  • packages/error/src/index.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-07T21:41:18.027804Z 3140214 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://cursor-radio-26-mode-lifecycle-errors-4d16-radio.cwav.workers.dev (commit 3140214)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://94a2395d-radio.cwav.workers.dev 3140214 2026-11-07T21:42:26.181Z Visit the dashboard ↗

@fcastrovilli
fcastrovilli merged commit c8f9c8a into main Nov 7, 2026
4 checks passed
@fcastrovilli
fcastrovilli deleted the cursor/radio-26-mode-lifecycle-errors-4d16 branch November 7, 2026 23:28
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