Repository navigation
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
packages/contracts or packages/shared
Steps to reproduce
- Use a Claude subscription with extra usage (overage) enabled and a monthly spend limit.
- Use up the monthly extra-usage budget. Claude's
rate_limit_eventthen reportsoverageStatus: "rejected"withoverageDisabledReason: "org_level_disabled_until". The 5-hour and weekly windows still have room (status: "allowed"). - Set a fallback model in Settings → Threads, for example a Codex model.
- Start a new thread in a project whose default model is a Claude model.
Expected behavior
New threads keep the Claude default model. A used-up extra-usage budget only matters after the plan limits run out, so Claude is not out of usage. The fallback should only apply when a window that actually blocks requests is exhausted.
Actual behavior
The composer switches to the fallback model and shows "Using GPT-6.1-Sol · Claude is out of usage", with no "resets …" time.
The cached Claude provider snapshot at that moment:
[
{ "id": "five_hour", "usedPercent": 18, "resetsAt": "2026-11-14T03:20:00.125Z" },
{ "id": "seven_day", "usedPercent": 4, "resetsAt": "2026-11-20T02:00:00.125Z" },
{ "id": "seven_day_fable", "usedPercent": 0, "resetsAt": "2026-11-20T02:00:00.000Z" },
{ "id": "monthly_spend", "kind": "monthly", "label": "Monthly spend", "usedPercent": 100 }
]Cause, as I read the 0.1.9 bundle:
claudeUsageResponseToLimits(apps/server/src/provider/claudeUsageLimits.ts) adds amonthly_spendwindow fromreadSpendPercent, with noresetsAt.exhaustedUsageWindow(packages/shared/src/usageLimits.ts) treats any window withusedPercent >= 100as exhausted when itsresetsAtis missing or in the future. ForclaudeAgentit returns that window, so the new-thread fallback kicks in.
The server's own turn-blocking logic is already correct here. It only counts Claude as blocked when status === "rejected" and overage is not allowed. Only the new-thread fallback check disagrees.
Related, but neither fixes this:
- [Bug]: Exhausted Fable weekly limit marks all Claude models as out of usage #32015 / fix(shared): a model-scoped Claude limit no longer blocks other Claude models #32016 exempt model-scoped
seven_day_<model>windows.monthly_spendstill counts as exhausted. - fix(usage): Claude monthly spend shows pace and a reset countdown #34162 gives
monthly_spenda reset time. That makes the banner read "resets Dec 1", but new threads would still fall back for the rest of the month.
Suggested fix: leave monthly_spend (extra-usage spend) out of exhaustedUsageWindow for claudeAgent, or only count it when the plan windows are also exhausted.
Impact
Major degradation or frequent failure
Version or commit
0.1.9
Environment
Linux server (remote environment), web client, Claude Agent SDK provider on a Claude subscription, fallback model GPT-6.1-Sol (Codex)
Workaround
Click "Use " on the notice or dismiss it, or clear the Fallback model setting.
Activity
juliusmarminge commentedon Nov 14, 2026
I tried to reproduce this on the current build and could not.
Commit 83ee1f5 (origin/main). A real app run needs a Claude provider signed in with first-party OAuth and a real usage snapshot, which this VM does not have, so I reproduced it at the logic layer the client uses. In packages/shared/src/usageLimits.test.ts ('new thread model fallback'), I called resolveNewThreadModelSelection with a claudeAgent default (claude-opus-5-5), a Codex fallback (gpt-6.1-sol) and the reporter's exact snapshot: five_hour 18%, seven_day 4%, monthly_spend 100% with no resetsAt. Result on main: the selection is the Codex fallback, not the Claude default (
vp test run src/usageLimits.test.ts -t "new thread model fallback"gives 1 failed, 32 passed). The test is pushed to factory/repro-36483 (7025b4d).Closing as not planned. If it still happens for you, reply with the exact steps and the version you are on and it will be looked at again.
alanpog commentedon Nov 14, 2026
Thanks for writing the test. I think it confirms the bug rather than ruling it out:
7025b4d736expects the Claude default to be kept, and it fails on main (your commit message says the same: "exhaustedUsageWindow counts the monthly_spend window as exhausted for claudeAgent"). Getting the Codex fallback for that snapshot is the behavior I reported. Still happening on 0.1.9. Could you reopen?