Skip to content

v0.4.1

Latest

Choose a tag to compare

@github-actions github-actions released this 23 Sep 14:30
v0.4.1
4408a4d

Two fixes that only show up under load: a rate-limited usage poll no longer makes cux poll harder, and model-scoped weekly caps are finally read at all.

Rate-limited polling made itself worse (#53)

The report was one seat returning 429 continuously for over two hours while its sibling, in the same sweep, refreshed fine — and that seat's polled_at frozen 2h24m old. Those two facts turned out to be one fact.

A failed poll was recorded nowhere. The cache entry was left untouched, so polled_at kept pointing at the last success and the reading went on looking stale — and staleness is the only thing coalescing skips on. So the account that couldn't answer was the one every caller re-asked, every time, while the accounts that answered were coalesced away. Coalescing exists to keep N sessions off this endpoint, and it switched itself off exactly when the endpoint was asking for less load.

A refusal is now held against the reading already cached: the windows and polled_at stay as they were, a failure count goes up, and a hold-off is recorded — a minute, doubling, capped at fifteen. A Retry-After the endpoint names wins if it's longer. The hold-off lives in the shared cache, so every session on the host backs off together rather than each discovering the limit alone, and it applies to uncoalesced callers too, who were the ones hammering.

Measured: five uncoalesced refreshes against a refusing endpoint now make one request instead of five.

Thanks @watsonix — the frozen polled_at was the whole diagnosis.

Model-scoped weekly caps were never read (#52)

The open window set shipped in 0.3.13 so ranking would stop assuming a fixed Opus/Sonnet pair. It has had nothing to read ever since: the model-scoped caps only arrive in the endpoint's limits[] array, and the top-level seven_day_* keys it was reading are null. A seat sitting at its Fable cap ranked as perfectly healthy, got picked, refused the next call and swapped straight back.

Each weekly_scoped entry now becomes a window keyed by model family, so every spelling and every future version of one model lands in the same place. Top-level windows at 0% with no reset are dropped — that's how the endpoint reports programs that don't apply to the seat, and they were showing up as noise.

Contributed by @carlotestor, who pulled the full response off four Max seats to settle it — two of them at their Fable cap, both of which would have ranked as having room before this.

Upgrading

Nothing to do.