Repository navigation
feat(autoplay): wire recentSkipCount into mood detection - #829
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, 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 have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ 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 |
|
Failed to generate code suggestions for PR |
Track early skips (< 30%) per guild with an LRU cache in trackHandlers. The counter increments on each qualifying skip and resets when a track plays to >80% completion. detectSessionMood now receives the real skip count instead of the hardcoded 0, so session mood correctly shifts toward energetic/exploratory when the listener is skipping rapidly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
17dcf4f to
a634b91
Compare
|
Track early skips (< 30%) per guild with an LRU cache in trackHandlers. The counter increments on each qualifying skip and resets when a track plays to >80% completion. detectSessionMood now receives the real skip count instead of the hardcoded 0, so session mood correctly shifts toward energetic/exploratory when the listener is skipping rapidly. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Promote [Unreleased] entries into the v2.10.0 section, bump root + workspace versions from 2.9.0 to 2.10.0, and update the lockfile. Release highlights: - Spotify 429 retry hardening (#808) - Last.fm canonical metadata + multi-artist scrobble fix (#821) - Autoplay Spanish-gospel-block + sertanejo prioritization series (#817-#820, #827, #829, #830) - Review-tools revamp: Claude review + Danger + chilled CodeRabbit via org-level reusable workflows (#838) - Coverage threshold pinned for phase-2 test cleanup (#835) - CI extended to release/** branches (#816)



Summary
guildRecentSkipCountsLRU cache (per-guild, 30-min TTL) intrackHandlers.tsto track early skipsgetRecentSkipCount(guildId)for use in replenishergetRecentSkipCount(replenishGuildId)intodetectSessionMood()inreplenisher.ts— replaces the hardcoded0TODOWhy
detectSessionMoodhad a0 /* TODO: wire recentSkipCount */for 6 months. A guild that skips 5 tracks in a row was still being served "similar" mood recommendations instead of shifting to exploratory/energetic mode. This connects the skip signal to the mood algorithm.Test plan
trackHandlers.spec.ts: 22 tests (added 2 new — skip count increments, reset on completion)replenisher.spec.ts: 8 tests all pass🤖 Generated with Claude Code
Greptile Summary
The PR wires
getRecentSkipCountintodetectSessionMood, replacing a 6-month-old hardcoded0. A per-guild LRU cache tracks early skips and resets on natural track completion. One new P2 finding: thesessionMoodCacheinreplenisher.tsis not invalidated when the skip count resets, causingrestless: trueto persist for 1–2 extra replenish cycles after a settling track completes.Confidence Score: 5/5
Safe to merge — all findings are P2; the skip count wiring is correct and tests pass.
Only P2 findings remain after prior review rounds addressed the most critical concerns. The stale mood cache window is a minor behavioral imprecision that self-corrects within 2 tracks.
No files require blocking attention;
replenisher.tshas the stale-mood-cache edge case worth a follow-up.Important Files Changed
guildRecentSkipCountsLRU cache with increment on early skip and delete on >80% completion;updateAgeOnGet: trueflag means TTL resets on every read from replenisher, not just on writes.getRecentSkipCountintodetectSessionMood; introduces a circular module dependency and a stale mood cache window of 1–2 cycles after skip count resets.afterEachcleanup.Comments Outside Diff (1)
packages/bot/src/handlers/player/trackHandlers.ts, line 285-292 (link)durationMS > 20_000guard present in the skip pathhandlePlayerSkiponly increments the count whentrack.durationMS > 20_000, buthandlePlayerFinishresets the count for any track duration that reaches >80% completion. A jingle or interstitial shorter than 20 s that autoplays to completion would silently clear an active "skip storm" signal. Adding the same duration guard keeps the two sides of the state machine symmetric.Reviews (3): Last reviewed commit: "feat(autoplay): wire recentSkipCount int..." | Re-trigger Greptile