Repository navigation
docs(decisions): adr for youtube extraction reliability gating - #1471
Conversation
Records the #1468 decision: fix recurring youtubei "No results found" by adding po_token+visitorData to the existing extractor (not proxy / oauth / extractor-swap), deferred behind a homelab verification gate. The decision-critic (artifact-only) flagged the generator-works-on-residential-ip claim as unverified, so the commit is gated on a homelab test; escalation path is yt-dlp-as-primary. Refs #1468
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Review limit reached
More reviews will be available in 31 minutes and 15 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
|
Failed to generate code suggestions for PR |
There was a problem hiding this comment.
No issues found across 1 file
Auto-approved: Adds an architecture decision record (ADR) for YouTube extraction reliability, a documentation-only change.
Re-trigger cubic
|
## What Closes #1468 — the `#play` "No results found" half of the 2026-06-16 incident. ## Verification reversed the diagnosis The prior ADR (#1471) guessed po_token / YouTube IP-blocking. I ran the verification gate from the home network's **residential** egress IP (same public IP the homelab uses), with the installed `discord-player-youtubei@3.0.0-beta.4`: - raw `youtubei.js` `getBasicInfo` (full player) → `playability: OK`, **26 streaming formats**, no po_token - the extractor's real path (`discord-player-youtubei` on a real `discord.js` Client → `Player`, as the bot registers it), **no po_token**: `watch?v=` URL → 1 track + stream OK; `youtu.be` → 1 track + stream OK; text search → 19 tracks + stream OK **→ the IP is not blocked and po_token is not needed.** ADR updated to record the reversal. ## Actual root cause (`playerFactory.ts`) Extractor registration is fire-and-forget, and YouTube was sequenced **behind** an awaited, **un-timed** `play-dl.getFreeClientID()` network call (play-dl is unmaintained). Registration failures were swallowed by `warnLog`. So a slow/hung play-dl init or a transient registration failure — likely right after the ~17:00 restart that also caused the #1467 auto-join — left the bot with **no YouTube extractor**, and every `#play <url>` returned "No results found" until restart. ## Fix - register YouTube **before** the play-dl SoundCloud init (extractor priority unchanged: Spotify → YouTube → SoundCloud …) - bound `play-dl.getFreeClientID()` with a 10 s timeout (new dependency-free `withTimeout` helper) - retry youtubei registration once; **escalate a final failure to `errorLog`** so the degraded state is visible instead of silently swallowed ## Tests - `withTimeout.ts` covered by 3 new cases in `playerFactory.spec.ts` (resolve / timeout / propagate-rejection) — 20/20 pass - existing `playerFactory.test.ts` 11/11 pass; bot type-check clean - live reproduction above confirms the extractor itself is healthy @cubic-dev-ai <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Hardened YouTube extractor registration to stop the “No results found” regression for `#play`. We register YouTube earlier, bound the `play-dl` SoundCloud init with a timeout, and added retry + clear error logging to avoid silent degraded boots. - **Bug Fixes** - Register `discord-player-youtubei` before `play-dl` SoundCloud init; extractor priority unchanged. - Add `withTimeout` and bound `play-dl.getFreeClientID()` to 10s. - Retry YouTube extractor registration once and escalate a final failure to `errorLog`. - Updated ADR after verification: `po_token` not needed; added tests for `withTimeout`. - **Refactors** - Simplified `withTimeout` by removing a dead timer guard. <sup>Written for commit 2999d59. Summary will update on new commits.</sup> <a href="https://cubic.dev/pr/LucasSantana-Dev/Lucky/pull/1472?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. -->



What
Records the decision behind #1468 (the
#play"No results found" half of the 2026-06-16 voice incident) via/research-and-decide.Decision (deferred, direction decided): fix YouTube reliability by adding
po_token+visitorDatato the existingdiscord-player-youtubeiextractor (not a proxy, not OAuth, not an extractor swap), gated on a homelab verification test — because the bot egresses via a residential homelab IP and thedecision-critic(artifact-only Opus) flagged "a Node po_token generator works on that IP" as the load-bearing, unverified claim. Escalation path if po_token churns: yt-dlp-as-primary metadata extractor.This keeps #1468 honest as
needs-info(blocked on homelab logs/test) while preserving the rationale so the next operator-assisted session can act immediately.Process: Phase 1 research (discord-player-youtubei v3 / 2026 YouTube auth landscape), Phase 2
decision-critic→ NEEDS_REVISION (gate added), Phase 3 skipped (defer-with-gate), Phase 4 this ADR.@cubic-dev-ai
Summary by cubic
Adds an ADR documenting the decision for #1468 to improve YouTube extraction reliability by adding
po_token+visitorDatato the existingdiscord-player-youtubeiextractor, gated on a homelab verification test, withyt-dlpas the escalation path. It also recommends structured logging on youtubei extraction failures to collect evidence and clarify user-facing errors.Written for commit ad562f8. Summary will update on new commits.