Claude usage limits: a rate_limit_event after a failed probe is published as a complete window list
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 23k
- Forks
- 5.9k
- Avg merge
- 11h 14m
- Merged PRs (30d)
- 357
Description
Reading apps/server/src/provider/providerUsageLimits.ts at 052c7ae: when the boot probe fails, the published limits are { windows: [], unavailable: { reason: "probeFailed" } }. A rate_limit_event during a turn then goes through applyUsageLimitsUpdate, which merges its one window onto the empty list and rebuilds the snapshot without unavailable. The result looks like a full read with only seven_day, and resolveUsageLimitsAfterProbe keeps it over later failed probes because the marker is gone.
Seen on 0.0.43-nightly.20260916.1825 after the update restarted the app: the Claude cache held only the weekly window for about 6 minutes, until a refresh-all re-ran the probe. A second Claude instance with no active turn had no windows the whole time.
Possible fix: keep unavailable, or mark the snapshot partial, when merging onto a snapshot that had it. Related: hydrateCachedProvider in providerStatusCache.ts does not carry usageLimits across a restart, so every restart starts from nothing.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in apps/server/src/provider/providerUsageLimits.ts at applyUsageLimitsUpdate and resolveUsageLimitsAfterProbe, reproducing the failed-probe state before a rate_limit_event arrives. Review hydrateCachedProvider in providerStatusCache.ts for the restart behavior. Done means a partial update cannot make failed probe data look complete, and the unavailable marker or equivalent partial state remains distinguishable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100