Skip to content

Forward Chat streaming deltas in real time - #103

Merged
Upper9527 merged 1 commit into
mainfrom
codex/realtime-chat
Oct 21, 2026
Merged

Upper9527 merged 1 commit into
mainfrom
codex/realtime-chat

Conversation

@Upper9527

Copy link
Copy Markdown
Collaborator

Chat requests with stream: true previously 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.

@Upper9527
Upper9527 merged commit c7b0931 into main Oct 21, 2026
1 check passed
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.

期望能支持LLM的推理内容实时流式返回

1 participant