Repository navigation
fix(ai): log usage polls of plan-less accounts at debug, not warn - #17057
Closed
trukhinyuri wants to merge 2 commits into
Closed
trukhinyuri wants to merge 2 commits into
trukhinyuri wants to merge 2 commits into
Conversation
Kimi Code answers {}, Z.AI answers "当前用户不存在coding plan", and ClinePass answers 404 "no plan history found for user" for accounts that use the provider without a metered plan. Those are steady states with nothing to meter, yet every usage poll logged them as warnings. Malformed or failed responses still warn.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
roboomp
reviewed
Oct 26, 2026
roboomp
left a comment
Collaborator
There was a problem hiding this comment.
P0 — scoped fixes for expected plan-less responses; all three provider regression suites pass (23 tests).
Only finding: add the assigned PR link to the external-contributor changelog entry.
Thanks @trukhinyuri for the focused fix.
H4vC
added a commit
that referenced
this pull request
Oct 26, 2026
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.
What
Accounts that use Kimi Code, Z.AI, or ClinePass without an active subscription plan return a steady-state "no plan" payload on every usage poll, and each poll logged a warning (hundreds of warnings per day per session):
packages/ai/src/usage/kimi.ts): an account without a Kimi Code plan answers{}.kimiUsageProvider.fetchUsagenow logs that empty object atdebug("Kimi account has no Kimi Code plan to meter") and returnsnull, while non-empty malformed payloads still log"Kimi usage response invalid"atwarn.packages/ai/src/usage/zai.ts): a pay-as-you-go account without a GLM Coding Plan answers{code: 500, msg: "当前用户不存在coding plan"}.fetchZaiUsagenow logs/不存在\s*coding\s*plan|no\s+coding\s+plan/iatdebugand returnsnull, while expired plans ("您的coding plan已过期") or backend errors still log atwarn.packages/ai/src/usage/cline-pass.ts): a free/credits-only account that never subscribed to ClinePass answers HTTP 404"no plan history found for user".fetchClinePassUsagenow logs 404 responses matching/no plan history/iatdebugand returnsnull, while other 404 or error responses still log atwarn.Verification
origin/main0b5c27ab24packages/ai/src/usage/{cline-pass,kimi,zai}.ts):bun test test/cline-pass-usage.test.ts test/kimi-usage.test.ts test/zai-usage.test.ts -t "treats an account without a"fails all 3 tests (0 pass, 3 fail:["ClinePass usage fetch failed"],["Kimi usage response invalid"],["ZAI usage response invalid"]).506b3d1e7ainpackages/ai):bun test test/cline-pass-usage.test.ts test/kimi-usage.test.ts test/zai-usage.test.tspasses (23 pass, 0 fail, 108 expect() calls);bun run check(oxlint,oxfmt,tsgo) exits0.