Repository navigation
Conversation
5 of 6 tasks
Extract the independent fix and its regressions from vllm-project#58968. Co-authored-by: Codex <noreply@openai.com> Signed-off-by: whx-sjtu <xiaowang990929@gmail.com>
whx-sjtu
force-pushed
the
whx/k3-stream-eof-20261008
branch
from
October 12, 2026 03:41
ae7afbe to
0de4078
Compare
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
Kimi K3 streaming can permanently hold text that looks like the start of an XTML marker when generation ends. Flush the literal unfinished suffix to its reasoning/content channel at EOF, so
value <is not truncated tovalue.Rebased onto main
bfa7e5b7afe40ebe48288801a2baf5c1135cd881. This remains an independent child of closed #58968.Claims
Keep complete framing/tool boundaries and reasoning suppression intact. This parser fix also applies to single-instance serving.
Validation
Validated on
0de4078b842913dafa869d221dfeb2414c8c5e67(2026-10-12): 142 passed. Changed-file pre-commit passed, including mypy for Python 3.11 and test/CI tethering checks.Real parser/protocol tests cover empty final deltas, split markers, reasoning/tool combinations, complete control markers,
include_reasoning=Falseand mixed DeepSeek reasoning/K3 tool parsing. Original October 8 production-file negative controls (194da61de1) gave 56 failing EOF cases / 86 passing controls; all 142 pass on this head.The defect was reproduced while investigating AIPerf empty-content errors, but the original generated-token evidence is unavailable, so those errors are not attributed wholesale to it. Exact-source model/HTTP-streaming validation remains pending.
The eight independent PRs compose on this same main. The combined CPU suite passes 344 tests, with 33 skips (32 ROCm/aiter-gated connector cases and one GPU LLM case) and one model-loading deselection. Counts overlap with the independent suites.
Details
Use the existing finalization callback and generated text. Reasoning tails stay in reasoning; tool-content flush runs only after reasoning ends. No generic parser interface or generation behavior changes.
Duplicate checks: #50229 broadly migrates K3 to Parser Engine and overlaps these files; this is the smaller fix for the existing implementation, and its regressions should survive that migration. #51400 handles complete message-close markers; #57366/#50291 handle non-streaming truncation; #60565 handles response-only transitions. They do not implement this legacy EOF flush. #58968 was superseded by the split PRs.
Merge danger: two-way door; blast radius: K3 streaming text extraction. Normal serving finalizes a choice once; this change does not extend the contract to repeated finalization.
#60655 addresses quoted think markers in non-streaming output. The broader Parser Engine migration in #50229 still overlaps these files; preserve the EOF behavior when composing it.
AI assistance was used for implementation, rebase, regression checks and this description. Human line-by-line review and the runtime acceptance items above remain pending. No performance improvement is claimed.
Pull Request Checklist
/pr-checklistskill. (Mandatory for agents, optional for humans).