Skip to content

Reject undelimited SSE frames at EOF - #181

Merged
AetherAI3 merged 1 commit into
mainfrom
fix/sse-eof-terminal
Sep 27, 2026
Merged

AetherAI3 merged 1 commit into
mainfrom
fix/sse-eof-terminal

Conversation

@AetherAI3

Copy link
Copy Markdown
Owner

Summary

The SSE decoder previously parsed the last buffered data: line at EOF even when the server never sent the blank-line event delimiter. An undelimited done frame could therefore mark an interrupted chat turn as successful.

Require the delimiter before dispatching a frame. An unfinished data: line now raises StreamIncompleteError, preserving the turn's uncertain result and allowing dev-session consumers to reconnect. Trailing comments remain harmless.

Verification

  • npm run build
  • node --test --test-isolation=none dist/test/stream.test.js dist/test/turn_lifecycle.test.js dist/test/brain_cloud_dev.test.js dist/test/client.test.js (58 passed)
  • git diff --check

@AetherAI3
AetherAI3 merged commit 67cb640 into main Sep 27, 2026
9 checks passed
@AetherAI3
AetherAI3 deleted the fix/sse-eof-terminal branch September 27, 2026 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant