test(radio): Lock YouTube provider outage failover for RADIO-25
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 succeedsapps/radio/src/lib/youtube/client.test.ts— curatedresolveItempool exhaustion matching the event shapeapps/radio/src/lib/platform-item-loader.test.ts— loader keepsYOUTUBE_CLIENT_RESOLUTION_FAILED+ aggregate cause for UI/reportingpackages/error/src/index.test.ts— pool exhaustion stayserror_expected=false(ops visibility; not silenced)apps/radio/src/lib/platform-stream-refresh.test.ts— YouTube refresh throws go throughonFailedwithDJ_YOUTUBE_REFRESH_FAILEDrequest 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: truewas rejected: existing reporting policy and tests treatYOUTUBE_CLIENT_RESOLUTION_FAILEDas unexpected so curated-pool outages remain visible in Sentry. - DJ YouTube refresh still throws (by design) into
onFailed; deck reporting currently defaults that path toPLAY_ERRORrather than the request’sDJ_YOUTUBE_REFRESH_FAILEDcode. 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.


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, anderror_expected=falsereporting. - Sentry visibility for curated relay outages stays as-is; DJ refresh still throws into
onFailedbut deck reporting maps it toPLAY_ERROR(unchanged).