Repository navigation
fix(kimi): read the usages.limit_* quota shape before the legacy one - #30
Merged
vadymhimself merged 1 commit intoNov 15, 2026
Merged
Conversation
…(rebased #6) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
✅ Deterministic PR hygiene checks passed. |
vadymhimself
merged commit Nov 15, 2026
aa80674
into
release/2.65.0-vadymhimself.15
34 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Kimi's
GET /coding/v1/usagesnow answers with ausagesobject (limit_5h,limit_7d,limit_month_total,limit_month_code, each{used_ratio 0..1, reset_time}), the shape Kimi's own client reads (MoonshotAI/kimi-codepackages/oauth/src/managed-usage.ts). The gateway only read the legacylimits[]/totalQuotablocks, so Kimi limits showed wrong. This is #6, rebased onto the current release line.What
src/providers/quota/vendor-probes-key.ts: whenusagesis present, onlylimit_5h(5-hour),limit_7d(weekly) andlimit_month_total(monthly) are read, and the legacy blocks are ignored. Ratios may be numbers or numeric strings; a missing or non-finite ratio is skipped. Withoutusages, the legacy parse is unchanged.release-version-sources sync(all 4 sources).Tests
tests/providers/provider-quota.test.ts: the main case loads Kimi's documented payload fromfixtures/external/kimi/(copied from the vendor client's own test, README says so; no live body has been recorded). Two edge cases (legacy blocks next tousagesare not read; 0, string and missing ratios) are marked as edge input, not provider samples.Eval added/updated: a Kimi usages answer in the vendor's documented shape shows 30% 5-hour, 20% weekly and 40% monthly, and legacy placeholder blocks beside it are ignored.
Supersedes #6.
🤖 Generated with Claude Code