mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-26 09:52:11 +03:00
fix(gemini): correct misleading SAFETY comment — partial SSE content is unavoidable
The comment claimed "leave no text content" but any text chunks streamed before the SAFETY finish reason have already been emitted. Updated to accurately describe the behavior.
This commit is contained in:
@@ -172,9 +172,9 @@ export function geminiToClaudeResponse(chunk, state) {
|
||||
} else if (reason === "max_tokens" || reason === "length") {
|
||||
stopReason = "max_tokens";
|
||||
} else if (reason === "safety" || reason === "recitation" || reason === "blocklist") {
|
||||
// Content was blocked by Gemini safety filters — map to end_turn but leave
|
||||
// no text content so the client sees an empty response rather than silently
|
||||
// appearing normal. The caller can inspect the raw finishReason if needed.
|
||||
// Content blocked by Gemini safety. Any text streamed before this finish
|
||||
// reason has already been emitted to the client — this is unavoidable in
|
||||
// SSE streaming. Map to end_turn (Claude has no "content blocked" reason).
|
||||
stopReason = "end_turn";
|
||||
} else {
|
||||
stopReason = "end_turn";
|
||||
|
||||
Reference in New Issue
Block a user