Skip to content

Conversation

@lochmueller
Copy link
Contributor

Q A
Bug fix? yes
New feature? no
Docs? no
Issues
License MIT

I have same problems with OpenRouter streaming mode, because openrouter send a : OPENROUTER PROCESSING to keep the SSE connection open (details on https://openrouter.ai/docs/api/reference/streaming#additional-information ). The current integration of the RawHttpResult do not handle that. As described in the OpenRouter documentation, the handling of SSE comments based on the Spec https://html.spec.whatwg.org/multipage/server-sent-events.html#event-stream-interpretation is not handled in the right way. We have to drop lines starting with a : because these are comments and cannot be handled via json_decode.

Fixed the integration and add a test incl. a comment.

@carsonbot carsonbot added Bug Something isn't working Platform Issues & PRs about the AI Platform component Status: Needs Review labels Dec 7, 2025
@lochmueller lochmueller marked this pull request as draft December 7, 2025 20:40
@lochmueller
Copy link
Contributor Author

Hmm... looks like the problem is not so easy to handle. The Symfony\Component\HttpClient\Chunk\ServerSentEvent should handle comments in the right way, and no comments should be part of the iteration.
I have to check, why I got errors/exceptions in json_decode, because comments hit the json_decode line...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working Platform Issues & PRs about the AI Platform component Status: Needs Review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants