fix(kimi): refresh expired usage tokens#7883
Conversation
|
Warning Review limit reached
Next review available in: 25 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds endpoint-scoped Kimi credential resolution and a locked OAuth refresh flow with credential validation, atomic persistence, unauthorized handling, and race detection. Updates the rate-limit fetcher to refresh expired credentials and use resolved endpoints. Expands tests for locking, concurrency, persistence, refresh failures, CLI races, missing refresh tokens, and endpoint-specific files. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
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.
Actionable comments posted: 1
🧹 Nitpick comments (1)
src/main/rate-limits/kimi-fetcher.test.ts (1)
37-43: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAssert the rename destination.
The mock updates
fsState.credentialsfor anyrenameSync(from, to), and the refresh test only checksfrom. A regression that renames the temp file to the wrong target path would still pass; asserttois the expected credentials path or make the mock only commit whentomatches it.Also applies to: 190-193
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: a5ccc8e7-cba3-4431-9e27-1810fe7b62b5
📒 Files selected for processing (3)
src/main/rate-limits/kimi-fetcher.test.tssrc/main/rate-limits/kimi-fetcher.tssrc/main/rate-limits/kimi-oauth-refresh.ts
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: a19983bf-d43e-41e0-b1d7-01a97f719e26
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (6)
package.jsonsrc/main/rate-limits/kimi-credential-location.tssrc/main/rate-limits/kimi-fetcher.test.tssrc/main/rate-limits/kimi-fetcher.tssrc/main/rate-limits/kimi-oauth-refresh.test.tssrc/main/rate-limits/kimi-oauth-refresh.ts
935befe to
7496c75
Compare
Summary
/usages.0600permissions so background usage polling keeps working after the CLI exits.Test Plan