Skip to content

Preserve streamed item identity in terminal Responses output - #53

Merged
ehartford merged 7 commits into
fix/required-tool-reasoning-stopfrom
fix/responses-stream-output-identity
Oct 15, 2026
Merged

ehartford merged 7 commits into
fix/required-tool-reasoning-stopfrom
fix/responses-stream-output-identity

Conversation

@ropoctl

@ropoctl ropoctl commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Use finalized streamed items as terminal output so item IDs, call IDs, arguments and statuses match events already delivered; preserve cancellation.

Validation: 16 stream/final identity cases and 47 inherited completion/error cases passed on CPU.

Stack base: #52. This PR contains one new commit.

Combined current-main check: all 26 prepared code/tooling branches applied together; 295 tests passed, eight XPU tests skipped, and 22 proxy/auditor fixtures passed. Hardware/model qualification remains as stated above.

@coderabbitai

coderabbitai Bot commented Sep 19, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 58 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3240435d-e437-4b2d-82d5-9bc7eeda8181
📥 Commits

Reviewing files that changed from the base of the PR and between a33f57b and a45c0ad.

📒 Files selected for processing: 7
  • perf/optimization_status.md
  • tests/entrypoints/test_responses_function_completion.py
  • tests/entrypoints/test_responses_stream_output_parity.py
  • vllm/entrypoints/openai/responses/serving.py
  • vllm/entrypoints/openai/responses/streaming_events.py
  • vllm/parser/abstract_parser.py
  • vllm/parser/engine/parser_engine.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ropoctl
ropoctl added this pull request to stack #74 September 19, 2026 23:55
Eric Hartford added 6 commits October 14, 2026 18:17
With include=["message.output_text.logprobs"], the text deltas carried
logprobs but emit_simple_content_done built its ResponseOutputText without
them. Since the terminal response now reuses the streamed items, the
completed response lost the logprobs the non-streamed response returns.

The streaming state now accumulates each message's delta logprobs. The
done part (and therefore the terminal output and stored response) carries
them in output_text form with UTF-8 token bytes, matching the non-streamed
response exactly, and response.output_text.done carries them too. When none
were streamed (not requested), the part keeps logprobs=None as before.

The abort test now also asserts the cancelled stream ends with the typed
error event (code response_cancelled) that the base branch introduced.
With a reasoning parser active, the non-streamed response reported
output_text logprobs for every generated token (reasoning, <think> and
</think> included), while the stream reported the whole chunk of any chunk
that produced content, so a chunk spanning the end of reasoning leaked its
</think> and the two paths disagreed.

Parser.content_token_count gives the parser's own token-level reasoning
boundary (the engine parser leaves reasoning at the first end marker; a
delegating parser uses its reasoning parser's content ids and treats a
prompt that already closed reasoning as all-content). The non-streamed
response slices its logprobs with it; the stream attributes each chunk by
the change in that count and holds content-phase tokens whose text is not
surfaced yet (the template scaffold, deferred whitespace) until the next
content delta, so streamed and terminal logprobs match the non-streamed
response.
@ehartford
ehartford merged commit 470a782 into main Oct 15, 2026
3 checks 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.

2 participants