fix: preserve incomplete upstream terminal status - #277
Merged
franciscojavierarceo merged 3 commits intoSep 11, 2026
Merged
Conversation
Signed-off-by: Chuyue Wang <stevenwang0805@outlook.com>
StevenWang-CY
requested review from
bbrowning,
franciscojavierarceo,
haoshan98,
jiahuei,
leseb,
maralbahari,
noobHappylife,
qandrew and
tjtanaa
as code owners
September 10, 2026 15:36
There was a problem hiding this comment.
🟢 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.donewith 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.
Signed-off-by: Francisco Javier Arceo <farceo@redhat.com>
franciscojavierarceo
approved these changes
Sep 11, 2026
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.
Fixes #273.
vLLM 0.29.0 can emit
response.completedwith an embeddedresponse.status: incompletewhen generation reaches its token limit. The gateway currently trusts the event type, returnscompletedwith no incomplete details, and can start another inference round after a completed built-in tool call.Normalize this exact event/status pair to
response.incompletebefore validation, accumulation, and delivery. This also handles the existingresponse.donealias 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:
The Python suite uses
CARGO_TARGET_DIR=targetbecause 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.