Repository navigation
Forward Chat streaming deltas in real time - #103
Merged
Merged
Conversation
This was referenced Oct 21, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Chat requests with
stream: truepreviously waited for a complete response before emitting two synthetic chunks. Forward OpenAI-compatible SSE deltas as they arrive while assembling one completed turn for existing session tracking. Preserve reasoning separately, structured tool fragments and usage frames; apply bounded queue backpressure and close upstream on cancellation.Fixes #29. Validate stream completion before recording success. A midstream failure emits a sanitized SSE error without
[DONE]and never replays output on a fallback endpoint. Existing bounded upstream retry/failover applies before stream establishment. Buffered calls, Bedrock and protocol conversion keep their existing paths; streaming requires structured tool calls instead of textual tool-tag repair.Validation: full suite before final route test 197 passed, 1 skipped; all 10 streaming tests passed including a gated upstream proving first-delta delivery before completion, cancellation, timeout, fragmented tools, failure/no-replay and endpoint routing. Ruff and format checks passed.