Skip to content

test(radio): Lock YouTube provider outage failover for RADIO-25 - #477

Merged
fcastrovilli merged 1 commit into
mainfrom
cursor/radio-25-youtube-provider-resolution-5bf8
Nov 7, 2026
Merged

fcastrovilli merged 1 commit into
mainfrom
cursor/radio-25-youtube-provider-resolution-5bf8

Conversation

@fcastrovilli

@fcastrovilli fcastrovilli commented Nov 7, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Investigation of RADIO-25 (YouTubeProviderAggregateError / YOUTUBE_CLIENT_RESOLUTION_FAILED, production radio@0.7.2, Chrome desktop, mode=dj, 2026-10-29).

Verified cause: every curated browser YouTube relay failed (HTTP 500 and network/CORS / Failed to fetch). Failover walked the pool, aggregated retryable provider errors, surfaced Every configured YouTube provider failed to the DJ pick UI, and reported the failure to Sentry as unexpected playback telemetry. That matches the intentional contract for volunteer Piped/Invidious outages; no app defect was shown that would justify a production change or Fixes RADIO-25.

What changed

Regression coverage only (synthetic mocked fetch/provider responses; no raw event URLs, PII, or secrets):

  • packages/platforms/src/youtube/provider.test.ts — HTTP 500 + network/CORS failover, aggregate diagnostics, recovery when a later provider succeeds
  • apps/radio/src/lib/youtube/client.test.ts — curated resolveItem pool exhaustion matching the event shape
  • apps/radio/src/lib/platform-item-loader.test.ts — loader keeps YOUTUBE_CLIENT_RESOLUTION_FAILED + aggregate cause for UI/reporting
  • packages/error/src/index.test.ts — pool exhaustion stays error_expected=false (ops visibility; not silenced)
  • apps/radio/src/lib/platform-stream-refresh.test.ts — YouTube refresh throws go through onFailed with DJ_YOUTUBE_REFRESH_FAILED request metadata

Evidence (red/green)

No failing production-path assertion was found before adding these locks; the new regressions are green against current main and document the intended behavior rather than driving a manufactured silence of unexpected errors.

Commands:

bun test packages/platforms/src/youtube/provider.test.ts \
  apps/radio/src/lib/youtube/client.test.ts \
  apps/radio/src/lib/platform-item-loader.test.ts \
  apps/radio/src/lib/platform-stream-refresh.test.ts \
  packages/error/src/index.test.ts
# 96 pass, 0 fail

bun run check   # pass
bun run typecheck  # pass

Base SHA: 7f7ed3bf52672df71a5514591af0b3a866708d0b (origin/main)

Limits / caveats

  • External relay health is outside this change; providers were not replaced or live-probed.
  • Marking pool exhaustion expected: true was rejected: existing reporting policy and tests treat YOUTUBE_CLIENT_RESOLUTION_FAILED as unexpected so curated-pool outages remain visible in Sentry.
  • DJ YouTube refresh still throws (by design) into onFailed; deck reporting currently defaults that path to PLAY_ERROR rather than the request’s DJ_YOUTUBE_REFRESH_FAILED code. That asymmetry is out of scope for this issue’s initial-resolution stack and was not changed.
  • Audio loading/lifecycle owned by other agents; this work stayed on provider resolution/refresh classification.

Sentry

Issue: https://avoidquest.sentry.io/issues/RADIO-25

No Fixes RADIO-25 — root defect not fixed because none was demonstrated in application code.

Open in Web Open in Cursor 

Summary by cubic

Adds regression tests that lock in the YouTube provider failover behavior behind RADIO-25. No production code changes; the new tests confirm the existing contract: pooled HTTP 500 and network/CORS failures aggregate into YouTubeProviderAggregateError and surface as YOUTUBE_CLIENT_RESOLUTION_FAILED, while recovery when a later provider succeeds still works.

  • Covers provider failover, client pool exhaustion, loader diagnostics, stream-refresh onFailed, and error_expected=false reporting.
  • Sentry visibility for curated relay outages stays as-is; DJ refresh still throws into onFailed but deck reporting maps it to PLAY_ERROR (unchanged).

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

View guided diff Turn on auto-fix

Add synthetic regressions for the Oct 29 radio@0.7.2 DJ resolution event:
HTTP 500 and fetch/CORS failures across the curated pool, aggregate
diagnostics, loader mapping, intentional unexpected reporting, and DJ
refresh onFailed handling. No production change: failover and reporting
already match the intended contract for volunteer relay outages.

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 55 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: ed482266-cb7a-40f8-bb23-3df2f6232c74
Commits

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

Files selected for processing: 5

  • apps/radio/src/lib/platform-item-loader.test.ts
  • apps/radio/src/lib/platform-stream-refresh.test.ts
  • apps/radio/src/lib/youtube/client.test.ts
  • packages/error/src/index.test.ts
  • packages/platforms/src/youtube/provider.test.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:43:50.045145Z f0b9e59 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

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://cursor-radio-25-youtube-provider-resolution-5bf8-radio.cwav.workers.dev (commit f0b9e59)

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://37eb24f4-radio.cwav.workers.dev f0b9e59 2026-11-07T21:44:36.118Z Visit the dashboard ↗

@fcastrovilli
fcastrovilli merged commit 65a2d77 into main Nov 7, 2026
4 checks passed
@fcastrovilli
fcastrovilli deleted the cursor/radio-25-youtube-provider-resolution-5bf8 branch November 7, 2026 23:32
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