fix: restore proper SSE frame delimiters

Emit real newline-delimited SSE frames for /v1/responses so clients can parse response.completed before the stream closes.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
mmc
2026-04-20 15:08:16 +08:00
parent 5e6c1c1a63
commit 866a212573

View File

@@ -1156,7 +1156,7 @@ def _responses_non_stream_from_chat_payload(chat_payload: Any) -> dict[str, Any]
def _sse_data(payload: dict[str, Any]) -> str: def _sse_data(payload: dict[str, Any]) -> str:
return f"data: {json.dumps(payload, ensure_ascii=False)}\\n\\n" return f"data: {json.dumps(payload, ensure_ascii=False)}\n\n"