SIGN IN SIGN UP

fix(proxy): report eligible pool usage exhaustion as 429 (#1541)

* fix(proxy): preserve pool usage-limit semantics

* style: normalize pool exhaustion imports

* fix(proxy): preserve structured retry hints

* docs(openspec): cover pool usage exhaustion errors

* fix(ci): satisfy pool usage PR gates

* fix(balancer): tighten usage-limit exhaustion reporting

* fix(balancer): preserve usage-limit reset metadata

* fix(balancer): require usage evidence for pool limits

* fix(balancer): preserve cap semantics for usage limits

* fix(balancer): preserve pressure usage priorities

* fix(proxy): resolve local overload codes against the canonical registry

The takeover of #1247 hardens selection_failure_response: instead of a
private duplicate of the account-cap code set, local capacity codes are
resolved via app.core.resilience.overload.LOCAL_OVERLOAD_CODES. This keeps
every local overload code (including codes added later, such as the
congestion fair-share code from #1536) on the stable 429 rate_limit_error
contract, and guarantees the new usage_limit_reached 429 mapping is applied
strictly to upstream usage/quota exhaustion of the whole eligible pool.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* test(proxy): pin the #1246 status matrix at the Responses surface

Adds externally-routed regressions for the takeover of #1247:

- /v1/responses and /backend-api/codex/responses return HTTP 429 with
  error.type = error.code = usage_limit_reached (and authoritative
  error.resets_at) when every eligible account is usage-exhausted
- resets_at is omitted when selection has no authoritative reset
- paused/deactivated/reauth-only pools keep the pre-existing no_accounts
  semantics, and the synthetic SSE failure keeps the #1479 sequenced
  response.created/response.failed SDK stream contract
- one usable account still fails over with no error

Also tightens the OpenSpec delta: authoritative-reset-only resets_at,
terminal (non-waitable) usage-limit failures, local capacity codes keep
their rate_limit_error contract, owner-scoped exhaustion keeps continuity
semantics.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* style: format unbound selection cap fallback

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* fix(proxy): honor usage exhaustion boundaries

---------

Co-authored-by: Omnidia Agent <agent@omnidia.local>
Co-authored-by: Darafei Praliaskouski <me@komzpa.net>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
S
Soju06 committed
897ae156cfd3254b2cd85e148afcb6275cd4bdf1
Parent: e9a9e8a
Committed by GitHub <noreply@github.com> on 8/6/2026, 8:29:32 AM