mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-09-17 20:32:25 +03:00
Pollinations and Perplexity-web can answer a genuine failure (expired session, exhausted free-tier credits) with HTTP 200 and a structurally normal completion whose assistant text is just the provider's own error prose. classifyProviderError() only inspects the body for 400/401/402/403/429, and detectMalformedNonStream() only checked structural emptiness, so the error text reached the client as a real answer and combo/auto-fallback never triggered. Adds classifyFakeSuccessBody() in errorClassifier.ts — allowlisted to pollinations/perplexity-web, reusing the existing CREDITS_EXHAUSTED_SIGNALS/ACCOUNT_DEACTIVATED_SIGNALS phrase lists, gated on short content with a dominant signal match — and wires it into detectMalformedNonStream() so the existing malformed-200 / combo-failover path picks it up with no other handler changes. Regression test: tests/unit/diagnostics-fake-success-13461.test.ts