You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@tangle-network/agent-runtime@0.128.0 treats valid numbered Server-Sent Events metadata from CLI Bridge as model text.
CLI Bridge emits an id-only comment frame for internal session metadata:
id: 1
: bridge-metadata
A real runAgentTaskStream call through createOpenAICompatibleBackend returned final text beginning with:
id: 1
: bridge-metadata
before the actual model response. The same run emitted three text_delta events although the model produced one response token string.
Root cause
streamResponseEvents drains any first line that does not begin with data: before waiting for the blank-line SSE event boundary. It therefore sends id: 1 through parseStreamChunk; the non-JSON fallback converts protocol metadata into text_delta.
Expected
Ignore comment-only and id-only frames as assistant output.
Parse id: plus data: as one SSE event.
Preserve numbered CLI Bridge replay frames without leaking metadata.
Remain correct when CRLF or event lines are split across transport chunks.
Completion criteria
Add regressions for id plus comment, id plus JSON data, comment-only heartbeat, split CRLF, and split frame boundaries.
Prove final assistant text contains only model content.
Observed 2026-08-04 with Runtime 0.128.0, CLI Bridge on localhost, Pi 0.83.0, and pi/tangle-router/glm-5.2. The request completed successfully in 15.176 seconds, which rules out an error-body fallback.
Problem
@tangle-network/agent-runtime@0.128.0treats valid numbered Server-Sent Events metadata from CLI Bridge as model text.CLI Bridge emits an id-only comment frame for internal session metadata:
A real
runAgentTaskStreamcall throughcreateOpenAICompatibleBackendreturned final text beginning with:before the actual model response. The same run emitted three
text_deltaevents although the model produced one response token string.Root cause
streamResponseEventsdrains any first line that does not begin withdata:before waiting for the blank-line SSE event boundary. It therefore sendsid: 1throughparseStreamChunk; the non-JSON fallback converts protocol metadata intotext_delta.Expected
id:plusdata:as one SSE event.Completion criteria
idplus comment,idplus JSON data, comment-only heartbeat, split CRLF, and split frame boundaries.Live reproduction
Observed 2026-08-04 with Runtime 0.128.0, CLI Bridge on localhost, Pi 0.83.0, and
pi/tangle-router/glm-5.2. The request completed successfully in 15.176 seconds, which rules out an error-body fallback.