xExtension-NewsAssistant icon indicating copy to clipboard operation
xExtension-NewsAssistant copied to clipboard

Add Robust SSE Buffering for OpenAI Stream Responses

Open moulai opened this issue 2 months ago • 0 comments

  • Add chunk buffering in helper.php::streamOpenAiApi() so partial SSE payloads are accumulated until a full event is available before decoding.
  • Normalize line endings, parse event: / data: segments, and requeue incomplete JSON payloads to avoid fatal errors when chunks split mid-object.
  • Buffer non-200 responses to capture the full error message before surfacing it to the client.

moulai avatar Nov 07 '25 12:11 moulai