Repository navigation
[Rust Frontend][3/3] Add Responses streaming lifecycle - #3
Open
franciscojavierarceo wants to merge 10 commits into
Open
franciscojavierarceo wants to merge 10 commits into
franciscojavierarceo wants to merge 10 commits into
Conversation
This was referenced Oct 7, 2026
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
The new streaming state machine warrants human review, particularly its untested recovery path for actual stream errors.
Review effort: Balanced
Findings: 1
What changed in this PR
Completes the Rust Responses API stack by adding streaming to the existing stateless endpoint.
Changes:
- Adds ordered lifecycle, reasoning, text, and function-call events with stable item IDs.
- Handles token limits, cancellation, and failures.
- Replaces streaming rejection coverage with six HTTP regressions.
| File | Description |
|---|---|
rust/src/server/src/routes/tests/responses.rs |
Adds streaming lifecycle and output regressions. |
rust/src/server/src/routes/openai/responses/streaming.rs |
Implements output-item event sequencing and ID tracking. |
rust/src/server/src/routes/openai/responses.rs |
Enables streaming transport and terminal response handling. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
franciscojavierarceo
force-pushed
the
codex/responses-streaming
branch
from
October 8, 2026 12:54
5c7bdd3 to
e37f5c1
Compare
6 tasks done
franciscojavierarceo
force-pushed
the
codex/responses-streaming
branch
from
October 27, 2026 03:41
e37f5c1 to
e0f1f9d
Compare
franciscojavierarceo
force-pushed
the
codex/responses-streaming
branch
from
October 27, 2026 11:26
e0f1f9d to
3db4c9a
Compare
franciscojavierarceo
marked this pull request as ready for review
October 27, 2026 11:39
franciscojavierarceo
force-pushed
the
codex/responses-streaming
branch
from
October 27, 2026 15:24
3db4c9a to
a2adabf
Compare
Extract the shared renderer prerequisites from vllm-project#58783 without changing their final implementation. Co-authored-by: Codex <noreply@openai.com> Signed-off-by: Francisco Javier Arceo <4163062+franciscojavierarceo@users.noreply.github.com>
Split the endpoint and non-streaming coverage from vllm-project#58783. Streaming is explicitly rejected until the next layer. Based on Canlin Guo original implementation (3de3969), with the existing compatibility fixes preserved. Co-authored-by: Canlin Guo <canlinguosdu@gmail.com> Co-authored-by: Codex <noreply@openai.com> Signed-off-by: Francisco Javier Arceo <4163062+franciscojavierarceo@users.noreply.github.com>
Co-authored-by: Codex <noreply@openai.com> Signed-off-by: Francisco Javier Arceo <4163062+franciscojavierarceo@users.noreply.github.com>
Preserve typed engine failures and numeric HTTP errors, use current sampling defaults, update token-aware test fixtures, and document the stateless endpoint. Co-authored-by: Codex <noreply@openai.com> Signed-off-by: Francisco Javier Arceo <4163062+franciscojavierarceo@users.noreply.github.com>
Keep earlier output items completed, preserve the final message or function call truncation status, and cover both HTTP response shapes. Co-authored-by: Codex <noreply@openai.com> Signed-off-by: Francisco Javier Arceo <4163062+franciscojavierarceo@users.noreply.github.com>
Keep text decoding enabled like Chat Completions and read cached tokens from the shared prompt-cache usage group. Update the existing usage regression to distinguish reused tokens from newly created cache entries. Co-authored-by: Codex <noreply@openai.com> Signed-off-by: Francisco Javier Arceo <4163062+franciscojavierarceo@users.noreply.github.com>
Complete the three-layer split of vllm-project#58783 with its existing streaming implementation and regressions. The full tree matches 53b6fc3 exactly; the pre-stack history remains on codex/responses-pre-stack-20261006. Co-authored-by: Canlin Guo <canlinguosdu@gmail.com> Co-authored-by: Codex <noreply@openai.com> Signed-off-by: Francisco Javier Arceo <4163062+franciscojavierarceo@users.noreply.github.com>
Co-authored-by: Codex <noreply@openai.com> Signed-off-by: Francisco Javier Arceo <4163062+franciscojavierarceo@users.noreply.github.com>
Consume boxed transfer metadata, handle typed error finishes, and document streaming support. Co-authored-by: Codex <noreply@openai.com> Signed-off-by: Francisco Javier Arceo <4163062+franciscojavierarceo@users.noreply.github.com>
Defer the final item-done event until the finish reason is known so token-limit status agrees with the terminal response. Keep earlier items completed and exercise text and function-call truncation through both HTTP modes. Co-authored-by: Codex <noreply@openai.com> Signed-off-by: Francisco Javier Arceo <4163062+franciscojavierarceo@users.noreply.github.com>
franciscojavierarceo
force-pushed
the
codex/responses-streaming
branch
from
October 28, 2026 10:32
a2adabf to
bfe6223
Compare
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.

Overview
add Responses SSE streaming with text, reasoning, function-call events, stable item IDs, and terminal handling for completion, token limits, and failures.
upstream review order: 1/3: renderer vllm-project/vllm#63901 → 2/3: non-streaming vllm-project/vllm#63902 → 3/3: streaming vllm-project/vllm#63903. all three upstream review PRs target
main; later diffs include earlier layers.this PR includes and depends on vllm-project#63901 and vllm-project#63902. the fork layer isolates the streaming changes.
Claims
vllm-chat.response.incomplete; close started items beforeresponse.failed, retain partial output, and preserve engine-supplied usage.Validation
Latest upstream synchronization — October 28
current head:
bfe6223420; rebased onto upstreamf4fd1ab68e. the fork keeps its native stacked bases; upstream PRs still targetmain.NotFoundandResponseNotFoundretain their existing wire envelopes; the LoRA/gRPC and Responses HTTP regressions pass.cargo test --locked -p vllm-server -p vllm-chat -p vllm-text --lib -- --test-threads=1: 586 server + 438 chat + 121 text passed (1,145 total), one existing text test ignored.git diff --check: passed.cargo nextestremains unavailable.f4fd1ab68e.the model-backed HTTP/Codex evidence below predates this synchronization (complete-stack head
3db4c9abf0); it was not repeated after this rebase. today's evidence covers compilation and deterministic wire/route/renderer regressions, not new model qualification. CI reruns on these new heads are separate from the earlier successful workflows. agentic-api was not changed or pushed.Earlier review and runtime evidence
reviewed and revised on October 27; streaming head:
3db4c9abf0.cargo test --locked -p vllm-server -p vllm-chat -p vllm-text --lib -- --test-threads=1: 559 server + 430 chat + 118 text passed (1,107 total), one existing text test ignored.cargo clippy --locked -p vllm-server -p vllm-chat -p vllm-text -p vllm-cmd --all-targets -- -D warnings: passed.cargo build --locked -p vllm-cmd, applicable pre-commit hooks, formatting, andgit diff --check: passed.f8f7634cb4; the fork's isolated stack bases are preserved.the review found that token-limit response status was correct but the last output item was still marked completed. the final
output_item.donenow waits until the finish reason is known. text and function-call route regressions assert that item-done snapshots exactly equal terminalresponse.output, including incomplete status; earlier items stay completed.fresh live tests, October 27, on the revised stack:
store: truevia a loopback test adapter. each executedcat nonce.txt, submitted its function-call output, returned the exact nonce, and emittedturn.completed. the adapter recorded two stored requests, with the second replaying one tool output.incomplete, dropping JSON items or rewriting streamed items to completed. local agentic-api commit28665d7fixes the shared ingestion/status conversions and custom-tool completion. 787 core + 9 stream-validation tests passed, five existing ignores; strict Clippy and all applicable pre-commit/file-size hooks passed. this follow-up remains local and unpushed, separately from feat: add shared vLLM Responses event contract vllm-project/agentic-api#382.configuration: Qwen/Qwen3.8-27B-FP8 revision
017b9c7af6b5689d5dd426a76e0bc077eb5ca20a, NVIDIA GB10, 32k context, language-model-only, 3 GiB KV cache, Qwen3 reasoning/Qwen3 Coder tool parsers. Rust was rebuilt from the revised sources; the installed Python engine was90531daf6, not this PR's Python checkout. the pass-through Codex run used agentic-api8a1e4ab; the stored run used the revised28665d7source. Codex used an isolated text-only catalog, Responses transport, and read-only sandbox; native custom tools, apps/plugins, images, web search, and multi-agent features were disabled.these runs establish the tested HTTP interoperability, not native library integration, model-quality/throughput qualification, unrestricted Codex support, or multimodal coverage. other model families, parallel tool calls, and Codex abort/disconnect remain unvalidated. the shared native adapter is still unfinished.
commands ran from
rust/withOPENSSL_DIRpointing to the local OpenSSL build.cargo nextestwas unavailable. tests ran serially after the previously reproduced shared chat audio-metrics collector collision. upstream pre-commit workflows passed on all three heads; the two newly pushed docs builds were still pending at the last check. local checkout and GitHub docs discovery checks passed; a fresh preview-search agent could not access the preview, while manual preview retrieval confirmed the supported-subset documentation.Details
this removes layer 2's temporary streaming rejection. the rebase consumes upstream's boxed transfer metadata without cloning, accepts the updated terminal-event fields, and handles typed error finishes.
the decode-failure regression checks partial text and stable item IDs, exactly one item close before one
response.failed, no completion event, and no fabricated missing usage. abort retains the Python-compatible completed event with cancelled response status; it is separate from the token-limit incomplete event.the frontend remains stateless: clients replay history, and agentic-api owns persistence and tool execution. the shared native adapter tracked by vllm-project/agentic-api#359 and vllm-project/agentic-api#382 is still unfinished. accepted reasoning-summary, text-verbosity, and encrypted-reasoning inputs are documented compatibility no-ops; valid service tiers are echoed without scheduling guarantees. layer 2 describes the remaining request/feature boundaries. the rendered Responses documentation now includes SSE and terminal behavior.
these are the existing vllm-project#58783 layers opened upstream at @BugenZhao's request, rather than competing implementations. the original authored history and discussion remain in vllm-project#58783. @gcanlin's vllm-project#53380 implementation is credited in the endpoint and streaming commits. this stack carries the prior implementation plus the current-main compatibility resolutions; the old source tips are backed up locally.
this layer is 4 files, +1267 / -57 relative to vllm-project#63902. Codex assistance was used. human review of every changed line and independent validation remain required before merge.
Pull Request Checklist
I used vLLM's
/pr-checklistskill. (Mandatory for agents, optional for humans).AI assistance was used during the creation of this PR.
Design Fit: Minimizes impact on core components, reuses existing functionality, and justifies added complexity.
Testing and Validation: Validates the change and ensures any added tests are meaningful and reliable, with CI coverage or documented CI resource constraints and validation performed outside CI.
Code Quality and Style: Keeps code and comments clear and concise, and updates relevant documentation and examples.
Pull Request Contents: Includes a brief summary and relevant links, supports claims with evidence, explains root causes and implementation trade-offs, and follows the contributing guide.
BEFORE SUBMITTING, PLEASE READ https://docs.vllm.ai/en/latest/contributing (anything written below this line will be removed by GitHub Actions)