Repository navigation
Conversation
…e models A used-up "Weekly · Fable" bucket (seven_day_fable) made exhaustedUsageWindow treat every Claude model as out of usage, because claudeAgent fell through to the default case. Match seven_day_<model> windows to the selected model, as the cursor, antigravity and opencode cases already do. Fixes pingdotgg#32015 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Claude model-specific weekly limits now affect only the matching model, preventing unnecessary fallback for other Claude models. Global limits and existing provider eligibility safeguards remain unchanged. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
Note Written by Claude Opus 5.5 in Claude Code, on behalf of saviocmc. This is the same fix as #28676, opened on Nov 1: the same Both PRs list a live check against an account with a spent Fable limit as not done. I ran that check on #28676 with Weekly · Fable at 0% left and the account-wide weekly at 42% left. With Fable as the default and Opus as the fallback, a new thread started on Fable before the change and on Opus 5.5 after it, with the fallback notice. Since the logic is identical, the same result applies here. Details and screenshots: #28676 (comment) |
Problem
When Claude's model-scoped weekly bucket is used up (Weekly · Fable, window id
seven_day_fable), T3 Code treats every Claude model as out of usage. New-thread selection falls back to the other provider, and text generation skips Claude, even though models such as Opus 5.5 still work. Reproduction details: #32015.The cause is
exhaustedUsageWindowinpackages/shared/src/usageLimits.ts. It has model-aware cases forcursor,antigravityandopencode, butclaudeAgentfalls through todefault: return exhausted[0].Change
Add a
claudeAgentcase. Aseven_day_<model>window, whichclaudeUsageResponseToLimitsbuilds from the CLI'smodel_scopedentries, now blocks only a selected model whose slug contains that model name. For example,seven_day_fableblocksclaude-fable-5-1but notclaude-opus-5-5. Session (five_hour), overall Weekly (seven_day) and Monthly spend still block every Claude model, as before.Scope and approval
Fixes #32015. This is a small, focused fix for an obvious bug: one switch case beside the existing per-driver cases, plus table rows in the existing test. It changes no contracts or UI.
Verification
claudeAgentrows to the existing "matches %s pools %s to %s" table inpackages/shared/src/usageLimits.test.ts:seven_dayat 100% with Opus selected: falls back.five_hourat 100% with Opus selected: falls back.vp test run packages/shared/src/usageLimits.test.ts: 66 passed. With the fix reverted, the Fable-bucket/Opus row fails as expected (1 failed, 65 passed).vp checkon both files andvp run typecheckinpackages/sharedboth pass.Written with Claude Opus 5.5 in Claude Code.
🤖 Generated with Claude Code