Repository navigation
Conversation
…onses render Signed-off-by: Yuan Li <dskwelmcy@163.com>
dskwe
requested review from
DarkLight1337,
aoshen02 and
noooop
as code owners
October 17, 2026 13:15
Contributor
|
This pull request has merge conflicts that must be resolved before it can be |
Preserve the parser grammar reasoning hint alongside upstream's effective chat-template kwargs handling. Co-authored-by: Hermes Agent Signed-off-by: Yuan Li <dskwelmcy@163.com>
Contributor
Author
|
Resolved the main-branch conflict in 9c40166 by merging current main, preserving the original feature commit. The resolution keeps both the grammar-derived Fresh validation: 14 render unit tests and 119 parser/protocol tests pass; the producer-driven regression still fails without the hint and passes with it. Patch-scoped pre-commit, including mypy, passes. Full model-serving integration was not verified locally; the PR description records that limitation and separates earlier HTTP evidence from these fresh runs. |
This branch has not been deployed
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
Preserve parser-derived Responses grammar gating across render → generate, matching coupled Responses serving introduced in #62052 and the existing transport from #60062.
Claims
reasoning_ended=true, so the existing generate consumer can apply it immediately.reasoning_ended=null, preserving engine prompt-based reasoning resolution.Validation
Main refresh (
9c40166d92)Merged upstream main
90c4a1a73eecea0428ee4303ad96c9fdeaac3f80, preserving the original feature commit. Resolved the overlap in ResponsesGenerateRequestconstruction by retaining both the parser grammarreasoning_endedhint and upstream's new effective-template-kwargs call. The aggregate diff against this main remains the original one-line production fix and regression tests.Fresh isolated Linux CPU validation using the complete resolved source tree:
The second command's local plugin only bypasses GPU/distributed cleanup; it does not replace parser/protocol behavior. Removing only the Responses hint on this resolved tree makes the producer-driven regression fail (
1 failed, 1 passed,None is True); restoring it passes. Patch-scoped pinned pre-commit, including mypy and CI test tethering, andgit diff upstream/main --checkpass. Full model-serving integration remains unverified: an attempted broader selection encountered 27 server-fixture setup errors because model snapshots are unavailable offline. Earlier HTTP/consumer evidence below was not rerun on this refresh.Original submission validation (historical)
The submitter performed the human line-by-line review and ran the relevant tests. Native generation/model-output validation is unavailable; no generated-model correctness claim.
Base:
21e09ea95926fcfe4df1c57bf2eb95123cab70c3(current main at submission). Commands use existing CPU Docker with explicit cwd/PYTHONPATH=/validation/responses-grammar-20261017 and .venv/bin/python; full harness, provenance hashes, and limitations in the private evidence record.Re-validated on this base after duplicate-search refresh (target files unchanged between the original test base and this base):
test_render_responses_carries_parser_grammar_hint: real BeamParser (existing test-beam fixtures, no manual flag assignment) adjusts the request; realrender_responses_requestmust emitreasoning_ended=Trueat message-start andNoneinside open reasoning. RED on baseline serving: 1 failed 1 passed 37 deselected (None is Trueon the message-start case); GREEN on fixed: 2 passed 37 deselected.-m pytest tests/entrypoints/scale_out/render/test_render.py -m skip_global_cleanup -q --disable-warnings: 12 passed 27 deselected (the skipped marker excludes live-server fixtures requiring model downloads). Existingtests/parser/test_beam_parser.py: 84 passed. All applicable patch-scoped pinned pre-commit hooks including mypy passed.render.entrystartup with diagnostic OPT tokenizer carrying the Beamresponse_templateand ASCII anchors;/v1/responses/renderPOST 200 for message-start and inside-reasoning cases. Baseline (serving sha 8d6e0796d9...): producer sets_grammar_from_parser=truebut wirereasoning_endedstays null in both cases. Fixed (sha 96925f7dff...): wirereasoning_ended=trueat message start, null inside reasoning;GenerateRequestJSON roundtrip preserves the value; xgrammar accepts full reasoning framing and rejects answer-only at message start on both variants (the wire hint, not the grammar, is the delta). All responses 200; servers exit 0.audit-responses-grammar-http-v1.py): 38/38 checks pass — harness hashes, HTTP status, per-variant serving-module child import provenance (baseline/fixed SHAs exact, all other modules identical), one-line source delta recomputed from git, producer order/flags, wire null-vs-true behavior, roundtrip, grammar semantics, cross-variant prompt equality.GenerateRequestJSON from the HTTP A/B artifacts was fed through realServingTokens.serve_tokens(repo's own test fixtures, MagicMock(spec=AsyncLLM) engine — no inference).engine_client.generatereceivedreasoning_ended=[null, null]on the baseline wire and[true, null]on the fixed wire, withreasoning_parser_kwargsthreaded intact in all 4 cases — the serving→generate hop is executed, not just traced. Independent saved-artifact audit (audit-responses-grammar-consumer-v1.py): 18/18 checks pass.Details
BeamParser stores a private
_grammar_from_parserflag when its constraint includes reasoning framing. Coupled Responses converts it to the existing engine hint, but Responses render previously discarded it when building GenerateRequest. Forward the same expression at that serialization boundary; no new field or parser logic.Related: #62108 (request-body log guard), #62114 (completion derender token IDs), #62163 (completion derender stream offsets) — independent frontend fixes validated with the same methodology.
AI assistance was used. Duplicate searches refreshed at submission (
reasoning_ended render,grammar_from_parser,scale_out render, plus full-title scan of open PRs): #62095 applies stop strings after reasoning in chat completion serving (different endpoint, no render/grammar transport); #44084 binds grammar on the client-facing Responses API (entrypoints/openai/responses/, protocol+kwargs plumbing) — different layer, no file overlap; #54078 lets the reasoning parser decidereasoning_endedin chat completion serving — same symptom family, different pipeline; no open PR touchesscale_out/render/serving.pygrammar transport.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.