You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1b1430f
Browse filesBrowse the repository at this point in the historyBrowse files
feat(agent-loop): Show auto-fallback as a chat message with quota type
When a 429 trips the auto-fallback, surface the model switch as a
persistent chat message in addition to the existing 8s toast. The
message names the primary model, the fallback target, the duration,
and which quota tripped (tpm / rpm / tpd / rpd) when the 429 body
identifies it.
The quota type is parsed from the server body via a new
`parse_limit_type` helper in the generic backend, plumbed through
`Throttler.record_rate_limit(limit_type=...)` and stored per-model
so the agent loop can read it back when arming the fallback. If the
body wording isn't recognised, the parenthetical suffix is omitted
and the message degrades to the generic form.
Tests cover the regex helper (Albert wordings, empty body, unknown
text, per-day-before-per-minute precedence, case-insensitivity) and
the throttler round-trip (record/read, success clears, latest-wins,
per-model isolation, backwards-compat for callers that omit the
kwarg).
0 commit comments