Skip to content

Accounts: show Claude's per-model weekly limits (Fable) - #808

Open
and-human wants to merge 1 commit into
zeronsh:mainfrom
and-human:claude-model-weekly-limits
Open

and-human wants to merge 1 commit into
zeronsh:mainfrom
and-human:claude-model-weekly-limits

Conversation

@and-human

@and-human and-human commented Oct 5, 2026 •

Copy link
Copy Markdown

Summary

  • Claude accounts now show per-model weekly caps (today: Fable) as an extra meter under Session and Week.
  • Why: /api/oauth/usage reports model caps only in its limits list (kind: "weekly_scoped", scope.model.display_name). The legacy seven_day_opus / seven_day_sonnet keys come back null. Zeron only read five_hour and seven_day, so an account at 85% of its Fable cap showed "Week 70%" and looked like it had room.
  • The footer ring already shows the most-used window, so it now follows the cap that actually binds.
  • The footer popover and the Settings → Accounts list both capped meters at 2. That cap is now MAX_USAGE_METERS = 3. Side effect: Copilot Free can now show its third quota (Completions) as well.
  • Engine-only parsing, no proto or doc changes. Rows without a model display name (for example surface-scoped limits) are skipped.

Test plan

  • New unit test claude_usage_windows_add_per_model_weekly_limits, built from the response shape seen live (null legacy keys, limits with session / weekly_all / weekly_scoped).
  • cargo test -p zeron-engine --lib claude_usage_windows: 3 passed.
  • Checked the live endpoint on two Max 20× accounts. One returned weekly_scoped Fable at 85% (severity: warning) while seven_day was 70%.
  • Manual: dev build (ZERON_DATA_DIR=~/.zeron-dev) Settings → Providers → Claude Code → Accounts shows Session 23% / Week 70% / Fable 85% (warning color) for the live account.
  • Manual: footer popover not captured. It uses the same render_usage_meter and the same cap.
  • cargo clippy -p zeron-engine -p zeron-ui --all-targets: no new warnings.

Screenshots

Before (footer popover, v0.2.103): Week 70%, no Fable row

(image to attach)

After (Settings → Accounts, dev build): Fable 85% shown in warning color

(image to attach)


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

/api/oauth/usage reports model caps only in its limits list
(weekly_scoped with scope.model.display_name); the seven_day_opus and
seven_day_sonnet keys come back null. Read those rows as extra windows
labelled by model, and raise the per-row meter cap from 2 to 3 so the
footer popover and Settings show them.
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