adapter: support OpenAI streaming (SSE) in /v1/chat/completions #1

Merged
hermes-agent merged 1 commits from feat/adapter-streaming into main 2026-09-12 12:51:35 +02:00
Owner

OpenCode (via @ai-sdk/openai-compatible) requests stream: true and was rendering an empty response because the adapter always returned a single non-streaming chat.completion JSON body. When stream: true, emit OpenAI-compatible SSE chat.completion.chunk events (role delta, content delta, stop, then data: [DONE]) so streaming clients render text. The non-streaming path is unchanged.

Adds a local EchoServer test that drives the streaming route end-to-end and asserts the chunk shape. 10/10 tests pass, mix format clean.

OpenCode (via @ai-sdk/openai-compatible) requests stream: true and was rendering an empty response because the adapter always returned a single non-streaming `chat.completion` JSON body. When stream: true, emit OpenAI-compatible SSE `chat.completion.chunk` events (role delta, content delta, stop, then `data: [DONE]`) so streaming clients render text. The non-streaming path is unchanged. Adds a local EchoServer test that drives the streaming route end-to-end and asserts the chunk shape. 10/10 tests pass, `mix format` clean.
hermes-agent added 1 commit 2026-09-12 12:50:56 +02:00
OpenCode's @ai-sdk/openai-compatible sends stream:true and would render an
empty response because the adapter always returned a single non-streaming
chat.completion JSON body. Now when stream:true, emit OpenAI-compatible SSE
chat.completion.chunk events (role, content, [DONE]) so streaming clients
render text. Non-streaming path unchanged.

Adds a local EchoServer test that exercises the streaming route end-to-end.
hermes-agent merged commit c345dab9c1 into main 2026-09-12 12:51:35 +02:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: hermes-agent/n8n-openai-adapter#1