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.
Triage#
Confirmed on current
main(394af73e0) and on0.0.43-nightly.20260916.1825(the cited052c7ae). Shipping0.0.42has the same merge. This is a real server usage-limits bug, not a Claude-only mapper mistake and not a one-off nightly glitch. A sparserate_limit_eventafter a failed (or missing) probe is published as a complete window list. Not already fixed. No later commit touchesapplyUsageLimitsUpdate/resolveUsageLimitsAfterProbe. Not a duplicate of #10597.What you reported. After the update restarted the app, the Claude boot probe failed and published
{ windows: [], unavailable: { reason: "probeFailed" } }. A turn then streamed arate_limit_eventforseven_day. The cache showed only the weekly window for ~6 minutes, as if that were the full read, until a refresh-all probe succeeded. A second Claude instance with no turn stayed empty the whole time.That matches the code.
What the code does.
probeFailedwith no windows.probeClaudeCapabilitiesomitsusagewhen the experimentalget_usagecall times out or throws (ClaudeProvider.ts).!capabilities.usagebecomesmakeUnavailableUsageLimits({ reason: "probeFailed" }).claudeRateLimitEventToUpdateemits one window (seven_day/five_hour/ a named overage bucket).ProviderUsageLimitsIngestionroutesaccount.rate-limits.updatedtoapplyUsageLimits.applyUsageLimitsUpdaterefuses updates only forunsupported. OnprobeFailed(orprevious === undefined) it upserts the one id onto[]and returnsmakeUsageLimits(...)— windows only, nounavailable, no partial flag. The no-op path (!changed && previous.unavailable === undefined) also rebuilds and strips the marker whenunavailablewas set.resolveUsageLimitsAfterProbekeepspublishedthroughprobeFailedwhen!published.unavailable. After step 3 the weekly-only snapshot looks like a full read, so the next failed probe will not replace it.unavailable” as complete.limitsNoticeis null in that case, so Usage draws only the weekly bar.collectLimitAccounts/ the!unavailableguard skip aprobeFailedsnapshot entirely — which is why the idle second instance correctly showed nothing.writeProviderStatusCachepersistsusageLimits, buthydrateCachedProvidercopies models / status / auth / skills and notusageLimits. Every restart is an empty merge base until a probe succeeds. Default provider-health refresh is 5 minutes (DEFAULT_PROVIDER_HEALTH_REFRESH_INTERVAL); ~6 minutes to a successful refresh-all is the expected self-heal, not a second bug.The merge is shared. Codex ticks the same function; Claude is just the easy repro because
rate_limit_eventnames one window.Related, not duplicates#
rate_limits_available: true+rate_limits: null→probeFailedinstead ofunsupportedresolveUsageLimitsAfterProbe/makeManagedServerProvidertest “keeps live usage windows across a failed probe”probeFailed/undefined. That test’s live window is applied after a successful probe.usageLimitsprevious === undefined.No open issue tracks “sparse update after a failed probe looks complete.”
Suggested fix#
Keep this a small server bugfix in
providerUsageLimits.ts. Do not invent a new limits protocol, and do not wait on #10597 or a cache redesign.applyUsageLimitsUpdate, ifprevious?.unavailable?.reason === "probeFailed"orpreviousis missing, keepunavailable: { reason: "probeFailed" }on the rebuilt snapshot (or a newpartialreason if you want bars + a notice).unsupportedstays rejected. Copyunavailableon the rebuild the same wayresetCreditsis copied — including the no-op rebuild that today strips it.resolveUsageLimitsAfterProbealready refuses to keep a published row that still hasunavailable. Leave that unless you also want streamed windows to survive a later failed probe; if so, keep published windows throughprobeFailedbut keep the incomplete marker. Do not keep an unmarked weekly-only list.hydrateCachedProvidershould copyusageLimitswhen the cache is correlated. That removes the restart empty-base. It does not replace (1)–(2) for a first failed probe.probeFailed+ empty windows +{ id: "seven_day" }update → stillunavailable, not a clean one-window snapshot.previous === undefined+ one-window update → not an unmarked complete list.limitsNotice/!unavailablechecks will hide bars and show “Could not read limits.” while the marker is on. That is the correct interim. Apartialreason + “Could not read all limits.” is extra scope, not the closer.Do not treat “wait for the 5-minute refresh,” “refresh-all,” or landing #10597 as the fix.
Workaround#
Open Usage → Limits (or otherwise force a provider refresh) after restart so
get_usagecan replace the snapshot. An idle instance will not show the false weekly-only list. No in-app way to mark a snapshot partial.Classification: bug · accepted · medium (server usage-limits; Claude-visible after restart + failed probe + turn; shared merge; self-heals on the next successful probe)