Skip to content

fix(usage): handle missing Token Plan quota fields - #141

Open
sonicg83 wants to merge 3 commits into
modelstudioai:mainfrom
sonicg83:codex/usage-token-plan-reset-times
Open

fix(usage): handle missing Token Plan quota fields#141
sonicg83 wants to merge 3 commits into
modelstudioai:mainfrom
sonicg83:codex/usage-token-plan-reset-times

Conversation

@sonicg83

@sonicg83 sonicg83 commented Aug 6, 2026

Copy link
Copy Markdown

Summary

  • add usage token-plan JSON and human-readable usage views
  • tolerate omitted reset timestamps when the corresponding quota percentage is zero
  • treat missing quota percentage fields as a possibly unlimited quota window

User-visible behavior

When a quota field is unavailable, the view reports that the relevant 5-hour or 1-week limit may be unlimited and directs users to verify it in the Bailian Token Plan console. A completely empty service response is valid and produces an empty JSON object with the same view guidance.

Root cause

The Token Plan usage service can omit reset timestamps for unused quota windows and can omit the quota fields entirely when a limit is configured as unlimited. The command previously treated these fields as required numeric values.

Validation

  • pnpm --filter bailian-cli-commands exec vp check
  • pnpm --filter bailian-cli-commands exec vp test tests/token-plan-usage.test.ts tests/e2e/usage-token-plan.e2e.test.ts

@sonicg83
sonicg83 marked this pull request as ready for review August 6, 2026 01:20
@sonicg83 sonicg83 changed the title fix(usage): handle missing Token Plan reset times fix(usage): handle missing Token Plan quota fields Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant