Skip to content

fix: preserve incomplete upstream terminal status - #277

Merged
franciscojavierarceo merged 3 commits into
vllm-project:mainfrom
StevenWang-CY:fix-terminal-response-status
Sep 11, 2026
Merged

fix: preserve incomplete upstream terminal status#277
franciscojavierarceo merged 3 commits into
vllm-project:mainfrom
StevenWang-CY:fix-terminal-response-status

Conversation

@StevenWang-CY

Copy link
Copy Markdown
Contributor

Fixes #273.

vLLM 0.29.0 can emit response.completed with an embedded response.status: incomplete when generation reaches its token limit. The gateway currently trusts the event type, returns completed with no incomplete details, and can start another inference round after a completed built-in tool call.

Normalize this exact event/status pair to response.incomplete before validation, accumulation, and delivery. This also handles the existing response.done alias and keeps the classified event, typed payload, and wire event consistent. Existing incomplete-response handling then preserves partial output, usage, and the termination reason, executes already completed gateway calls once, and stops further inference. Normal completion at the exact token budget remains completed.

Validation:

  • On unchanged current main, the final regressions produce six intended failures and five passing controls. On the exact committed patch, all eleven pass.
  • Tests cover exact wire preservation, aliases, empty/malformed/unknown statuses, no inference from token counts or details alone, strict lifecycle/ID validation, HTTP SSE and WebSocket delivery, successful local search, and SQLite close/reopen followed by inspection of the actual next upstream request.
  • The two regression binaries pass 50 fresh-process runs, including three concurrent workers: 125 core and 150 delivery/restart test executions.
  • Locked workspace/all-target/all-feature check and Clippy with warnings denied, formatting, 1,178 Rust workspace tests, binary builds, launcher contracts, source-install CLI E2E, 115 Python tests, and 117 cassettes / 264 turns pass. Applicable changed-file hooks and the remaining repository-wide hooks pass.

The Python suite uses CARGO_TARGET_DIR=target because its existing package test assumes that path; its initial failure with a global target directory reproduces on unchanged main. The eight PostgreSQL schema/storage tests that are ignored in the default Rust run also pass against a temporary PostgreSQL 17 cluster, which was stopped afterward. Three installation-only Python tests and one existing Rust doctest remain skipped/ignored. The repository-wide large-file hook was skipped for an existing local Apple Git hang; it passes on the full changed-file set.

This changes only SSE normalization for the known contradiction. JSON decoding and raw proxy behavior retain their existing contracts. Restart coverage establishes durable item-history replay; the existing storage schema does not persist terminal status, usage, or incomplete details. Validation uses real local HTTP/WebSocket gateways and a deterministic upstream fixture, without a live vLLM/LiteLLM or GPU run.

Contract references: vLLM 0.29.0 terminal event emission, OpenAI incomplete-response guidance.

Signed-off-by: Chuyue Wang <stevenwang0805@outlook.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The targeted normalization is consistent across event classification, payload handling, and wire delivery, with comprehensive regression coverage.

Pull request overview

Normalizes contradictory upstream completion events so incomplete status and details are preserved throughout validation, execution, delivery, and persistence.

Changes:

  • Reclassifies response.completed/response.done with an incomplete payload.
  • Adds strict normalization and lifecycle tests.
  • Adds HTTP, WebSocket, tool-loop, and restart coverage.
File summaries
File Description
crates/agentic-server-core/src/events/normalize.rs Canonicalizes contradictory terminal SSE events.
crates/agentic-server-core/tests/terminal_status_test.rs Tests normalization and strict decoding.
crates/agentic-server/tests/incomplete_response_test.rs Tests end-to-end delivery and persistence behavior.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Balanced

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@franciscojavierarceo
franciscojavierarceo merged commit 3b70271 into vllm-project:main Sep 11, 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.

Bug: token-limit termination loses incomplete status with agentic-api 0.6.0 and vLLM 0.29.0

3 participants