Files
nanobot/tests
Carmelo Campos 663ba82f00 fix(providers): honor configured fallbacks on "insufficient credits"
An OpenAI-compatible gateway can report exhausted credits as HTTP 400 with
the message "You have insufficient credits to make this request". The
arrearage marker lists cover "insufficient_quota", "insufficient balance"
and "out of credits", but not "insufficient credits", so
is_arrearage_response() returned False and _should_fallback() fell through
to its blanket HTTP-400 short-circuit. Configured fallbackModels were then
silently skipped and the raw provider error was returned to the user.

Add the missing phrasing to both the text-marker tuple and the structured
token frozenset. Arrearage detection already runs first inside
_should_fallback(), so recognizing the phrasing is enough to restore
failover; a plain malformed-request 400 keeps its existing non-fallback
behavior.

Refs #5967
2026-09-30 09:55:31 +08:00
..