Files
OmniRoute/open-sse/services
Bob.Hou ff320cbfd5 fix(combo): exempt content_filter from empty-content detection (#7973)
## Problem

When Gemini Flash returns a safety-filtered response (finish_reason:
content_filter, empty content), isEmptyContentResponse() misclassifies
it as a fake-success empty response and returns HTTP 502.  This triggers
the combo fallback chain and account cooldown escalation (5s → 10s →
20s → 40s), even though the response is a legitimate terminal state.

## Root cause

errorClassifier.ts line 14: LEGIT_EMPTY_OPENAI_FINISH only exempts
"length" and "tool_calls".  The "content_filter" finish reason
(mapped from Gemini's SAFETY/PROHIBITED_CONTENT) is not exempted,
so safety-filtered responses are treated as empty content failures.

## Fix

Add "content_filter" to LEGIT_EMPTY_OPENAI_FINISH so safety-filtered
responses pass through as valid (though filtered) completions.

## Testing

- 10/10 unit tests pass (empty-content-stopreason-3572.test.ts)
  including 2 new content_filter test cases
- E2E: hot-patched OmniRoute v3.8.48 on X500, verified the previously
  failing prompt (4.6KB review) now returns valid content instead of
  empty-content 502

Signed-off-by: Minxi Hou <houminxi@gmail.com>
2026-07-22 02:34:47 -03:00
..
2026-06-29 08:40:06 -03:00
2026-06-29 08:40:06 -03:00
2026-06-29 08:40:06 -03:00
2026-05-21 01:29:12 -03:00
2026-05-21 01:29:12 -03:00
2026-06-29 16:51:03 -03:00
2026-06-29 08:40:06 -03:00
2026-07-13 09:12:40 -03:00
2026-05-26 23:51:47 -03:00
2026-06-29 08:40:06 -03:00
2026-07-13 09:12:40 -03:00
2026-07-06 02:25:17 -03:00
2026-06-30 06:54:29 -03:00
2026-04-19 19:50:30 -03:00
2026-06-25 13:17:40 -03:00
2026-06-29 08:40:06 -03:00
2026-07-04 13:00:30 -03:00
2026-07-04 13:00:30 -03:00
2026-07-04 13:00:30 -03:00
2026-05-10 00:55:06 -03:00
2026-06-23 03:08:29 -03:00
2026-05-29 12:44:29 -03:00
2026-06-29 08:40:06 -03:00
2026-05-24 18:05:58 -03:00
2026-07-13 09:12:40 -03:00
2026-07-04 13:00:30 -03:00
2026-06-13 17:27:40 -03:00
2026-05-26 23:51:47 -03:00
2026-06-29 08:40:06 -03:00
2026-06-12 23:49:22 -03:00
2026-07-13 09:12:40 -03:00
2026-07-02 10:47:13 -03:00
2026-07-04 13:00:30 -03:00
2026-06-06 19:13:11 -03:00
2026-05-23 01:46:59 -03:00
2026-07-04 13:00:30 -03:00
2026-05-24 18:05:58 -03:00
2026-07-13 09:12:40 -03:00
2026-07-13 09:12:40 -03:00
2026-07-13 09:12:40 -03:00
2026-07-13 09:12:40 -03:00
2026-05-10 00:55:06 -03:00
2026-06-19 06:49:01 -03:00
2026-07-02 10:47:13 -03:00
2026-05-29 12:44:29 -03:00
2026-06-29 08:40:06 -03:00
2026-06-13 17:27:40 -03:00
2026-07-04 13:00:30 -03:00
2026-06-07 07:20:02 -03:00
2026-07-07 13:14:06 -03:00
2026-07-04 13:00:30 -03:00
2026-07-04 13:00:30 -03:00
2026-07-13 09:12:40 -03:00
2026-06-21 08:56:51 -03:00
2026-07-13 09:12:40 -03:00
2026-07-02 10:47:13 -03:00
2026-07-13 09:12:40 -03:00
2026-06-04 20:05:38 -03:00
2026-05-10 00:55:06 -03:00
2026-05-10 00:55:06 -03:00
2026-05-10 00:55:06 -03:00
2026-06-19 06:49:01 -03:00
2026-06-25 13:17:40 -03:00
2026-07-02 10:47:13 -03:00
2026-06-25 13:17:40 -03:00
2026-07-02 10:47:13 -03:00
2026-05-10 00:55:06 -03:00
2026-05-10 00:55:06 -03:00
2026-06-13 17:27:40 -03:00
2026-06-19 06:49:01 -03:00
2026-06-04 20:05:38 -03:00
2026-07-06 02:25:17 -03:00
2026-07-07 13:14:06 -03:00
2026-07-13 09:12:40 -03:00
2026-06-22 03:17:02 -03:00