xExtension-NewsAssistant
xExtension-NewsAssistant copied to clipboard
Add Robust SSE Buffering for OpenAI Stream Responses
- 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.