Files
OmniRoute/src/app
Diego Rodrigues de Sa e Souza 69bbcafcb4 fix(providers): classify ambiguous Mistral 401 instead of hard auth error (#7638) (#7718)
Mistral's quota-exhausted response is a bare 401 with a contentless
{"detail":"Unauthorized"} body — byte-identical to a genuinely revoked
key. classifyFailure() in the connection-test route always resolved
this to upstream_auth_error ("Invalid API key"), hiding the real
quota-exhaustion cause and misleading operators into rotating a still-
valid key.

classifyFailure() now accepts an optional `provider` and, for a bare
Mistral 401 with no explicit auth signal in the message (no "invalid
api key" / "token invalid" / "revoked" / "access denied" text), returns
`upstream_ambiguous_auth_or_quota` instead. A Mistral 401 that DOES
carry an explicit auth signal, and any non-Mistral 401, are unaffected
and still classify as upstream_auth_error (baseline preserved).

The new branching logic lives in a new module
(mistralAmbiguousAuth.ts) rather than inline in route.ts, keeping that
frozen file's line count within its file-size-baseline.json budget.

TDD: tests/unit/provider-test-mistral-401-classify.test.ts reproduces
the bug (RED against unfixed classifyFailure), proves the fix (GREEN),
and pins the baseline non-Mistral-401 behavior per the owner's
explicit requirement.
2026-07-19 02:31:36 -03:00
..
2026-03-09 15:12:51 -03:00
2026-03-09 15:12:51 -03:00
2026-03-09 15:12:51 -03:00
2026-03-09 15:12:51 -03:00
2026-03-09 15:12:51 -03:00
2026-03-09 15:12:51 -03:00
2026-03-09 15:12:51 -03:00
2026-03-09 15:12:51 -03:00
2026-06-20 14:55:24 -03:00
2026-07-13 09:12:40 -03:00
2026-06-19 06:49:01 -03:00
2026-05-10 00:55:06 -03:00
2026-06-19 06:49:01 -03:00
2026-06-19 06:49:01 -03:00
2026-06-19 06:49:01 -03:00
2026-06-19 06:49:01 -03:00
2026-06-19 06:49:01 -03:00
2026-06-19 06:49:01 -03:00
2026-07-02 10:47:13 -03:00
2026-05-24 18:05:58 -03:00