Repository navigation
fix(auto): an at-limit escape lands on a throttled idle peer; reset lifts a reported limit - #64
Open
deathemperor wants to merge 1 commit into
Open
deathemperor wants to merge 1 commit into
deathemperor wants to merge 1 commit into
Conversation
…ifts a reported limit Two ways the engine sat on a refused account while quota sat unused: - A peer whose usage endpoint 429s past the two-hour trust ceiling read as unknown and was never a target, so with every measured peer spent an at-limit account stayed put (`no-qualifying-candidate` every minute). The 429 throttles the endpoint, not the account: an at-limit escape now takes such a peer by its last good headroom when nothing measured has room. Not on failover, where the active account is unreadable too. - `reset` left a `limit-hit` report standing, and a report with a known deadline overrules every reading until then, so a just-reset account read spent until tomorrow. A successful reset now clears it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On 2026-10-09 the engine sat on a refused account while three idle accounts had all their quota.
Throttled peers were never a target. Anthropic's usage endpoint answered 429 (
rate_limit_error, Cloudflare edge, no request id) for slots 4, 5 and 7 for up to 19 hours. Their tokens were valid and fully scoped. Past the 2-hourRATE_LIMIT_TRUST_MAX_AGE_Stheir headroom read as unknown, so once every measured peer was spent, the active account at 100% gotno-qualifying-candidateevery minute. NowSnapshotkeeps the last good headroom of a slot whose trust lapsed under 429s alone. When the trigger isat-limitand neither the qualifying nor the fallback ranking found anything, those slots are ranked by that headroom. Failover is excluded: the active account is unreadable there too, so it would hop between blind targets. If the pick turns out to be spent, it costs one switch; staying put costs the session.resetleft alimit-hitreport standing. A report with a known deadline overrules every reading until that deadline (reported_limit_holds). The account read spent until 01:00 the next day after a successful reset, while Anthropic reported it at 4%, andautologgedall-exhausted.resetnow clears the report with the newUsageStore::clear_reported_limitbefore its forced fetch.Tests:
an_at_limit_escape_lands_on_a_peer_only_the_usage_throttle_hides(with an http-500 control),a_spent_reset_lifts_a_reported_limit_before_its_deadline. Written without a local Rust toolchain; CI is the first build.🤖 Generated with Claude Code