Skip to content

Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors

Merge branch 'pr-946' into release/v3.4.9

diegosouzapw7c76f7443ebb
diff --cc open-sse/utils/stream.ts
index 917e1e4bed,d2da946adf..56ae32857e
--- a/open-sse/utils/stream.ts
+++ b/open-sse/utils/stream.ts
@@@ -591,9 -591,12 +591,12 @@@ export function createSSEStream(options
// Content for call log is accumulated only from parsed (above) to avoid double-counting;
// do not add again from item here.
- // #723, #727: Sanitize intermediate stream chunks if source (client) is OpenAI format
+ // #723, #727: Sanitize only when the client-facing stream is OpenAI Chat format.
+ // When translating Responses -> Claude, `item` is already a Claude SSE event;
+ // sanitizing it as an OpenAI chunk strips message_start/content_block_delta/message_stop
+ // and causes Claude Code to drop the assistant message.
let itemSanitized: Record<string, unknown> = item;
- if (sourceFormat === FORMATS.OPENAI) {
+ if (sourceFormat === FORMATS.OPENAI || sourceFormat === FORMATS.OPENAI_RESPONSES) {
itemSanitized = sanitizeStreamingChunk(itemSanitized) as Record<string, unknown>;
// Extract reasoning tags from content if translation generated them