Repository navigation
[Rust Frontend] Accept empty stream_options without streaming - #62643
Merged
BugenZhao merged 2 commits intoOct 20, 2026
Merged
Conversation
Python chat and completions reject `stream_options` without `stream=true`
only when the object is non-empty, and Python's generate route has no such
check. Rust rejected any `stream_options`, including `{}`, on all three.
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
Isotr0py
approved these changes
Oct 20, 2026
Member
Author
|
/ci run |
|
✅ Triggered Buildkite CI #96157 for commit ℹ️ This PR is 16 commits behind upstream |
bantianyue
pushed a commit
to bantianyue/vllm
that referenced
this pull request
Oct 28, 2026
…roject#62643) Signed-off-by: Bugen Zhao <i@bugenzhao.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: vllm-agent <claw@inferact.ai>
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
Python chat and completions reject
stream_optionswithoutstream=trueonly when the object is non-empty (if data.get("stream_options") and not data.get("stream")in eachvalidate_stream_options), and/inference/v1/generatehas no such check. The Rust frontend rejects anystream_optionswithstream=falseon all three routes, including{}. This PR aligns the Rust checks with Python.Claims
"stream_options": {}without streaming and still reject astream_optionsobject that sets an option./inference/v1/generateacceptsstream_options, as in Python; the non-streaming handler already ignoresinclude_usageandcontinuous_usage_stats.stream=falsestream_options: {}stream_options: {"include_usage": false}stream_optionsValidation
Commands from
.buildkite/scripts/run-rust-frontend-cargo-ci.sh(style-clippyandtest), run from the repo root:validate_request_compat_accepts_empty_stream_options_without_streaming({}, through both chat layers) fail when the checks go back tostream_options.is_some().validate_request_compat_rejects_stream_options_without_streamingcover{"include_usage": false}and{"continuous_usage_stats": true}.validate_request_compat_accepts_stream_options_without_streamingreplaces the test that pinned the rejection.Details
StreamOptions::is_emptysits on the shared DTO (routes/openai/utils/types.rs) and destructures every field, so a new option has to be considered there. Chat has two overlapping checks (thevalidate_chat_cross_parametersschema validator andvalidate_request_compat), and both change together; completions changesvalidate_request_compat. The generate check came from mirroring chat in #43779; Python's generate never had it, so it is removed rather than kept as a Rust-only rejection.One edge case stays different: Python checks the raw JSON, so it rejects
{"include_usage": null}; Rust sees the deserialized options and accepts it like{}.Not a duplicate: the only open upstream PR touching
stream_optionsand the Rust frontend area, #61275, adds a new Python option and does not change this validation.AI assistance (Claude Code) was used to prepare this change; the human submitter reviewed every changed line.
🤖 Generated with Claude Code
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.