Skip to content

fix: finish Messages rounds at message_stop - #290

Merged
franciscojavierarceo merged 1 commit into
vllm-project:mainfrom
StevenWang-CY:fix-messages-stream-completion
Sep 12, 2026
Merged

franciscojavierarceo merged 1 commit into
vllm-project:mainfrom
StevenWang-CY:fix-messages-stream-completion

Conversation

@StevenWang-CY

Copy link
Copy Markdown
Contributor

Summary

Executor-managed /v1/messages streams suppress the upstream message_stop and keep waiting for HTTP EOF. If an upstream leaves the body open after its final event, the gateway withholds the final usage/stop and eventually emits a chunk-timeout error; with idle timeouts disabled, it hangs. A completed built-in tool round is similarly prevented from advancing. Anthropic defines message_stop as the final streaming event.

Mark the existing per-round state complete at message_stop, stop reading that round, and explicitly drop its upstream body before final delivery or tool execution. Preserve the single public message lifecycle, current clean-EOF compatibility, pre-terminal errors, client-tool ownership, and configured idle timeouts. The change is confined to the native Messages streaming loop; it adds no public API, configuration, dependency, schema, or persistent state.

Test Plan

  • On unmodified main 4497095, the identical final regression file produces seven intended completion failures and five passing controls. The patch passes all 12 tests, covering core and real HTTP completion, empty/token-limited messages, fragmented UTF-8/CRLF/no-space data, duplicate/trailing events, malformed/missing terminals, pre-terminal errors, mixed tool ownership, cancellation, and disconnect.
  • Replay both existing recorded Qwen Messages web-search rounds with their bodies held open after message_stop. Verify one visible lifecycle, final text and usage, contiguous indexes, successful real local search, the complete assistant turn and signature plus paired tool result in the actual second upstream request, independent-request recovery, body release, and zero Messages database writes. A missing-body-drop mutant fails this test.
  • Verify exact commit b6ded3b from a clean worktree: formatting, locked workspace compile and Clippy across all targets/features, all pre-commit hooks, and 1,372 Rust tests pass (nine existing ignores). Run the eight PostgreSQL tests separately against an isolated database; all pass and the database stops cleanly.
  • Run all 12 regressions in 50 fresh processes: 600 passes, including serial and concurrent runs. Python checks pass 115 tests with three installation-only skips; all 133 cassettes and 296 turns validate. Workspace binary build, launcher contracts, and CLI end-to-end tests pass.

The existing cassette payloads are reused without changes; the harness supplies the open-body transport condition. No fresh live-model, GPU, cross-platform runtime, or performance validation is claimed.

@franciscojavierarceo
franciscojavierarceo merged commit 5b6d695 into vllm-project:main Sep 12, 2026
14 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