[fix] Add tool call parser KimiK2RawIdDetector to keep original tool call id. - #25196
Merged
JustinTong0323 merged 1 commit intoMay 14, 2026
Merged
Conversation
guapisolo
requested review from
CatherineSue,
JustinTong0323,
ispobock,
merrymercy and
slin1237
as code owners
May 13, 2026 23:16
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
JustinTong0323
approved these changes
May 14, 2026
5 tasks
yueming-yuan
pushed a commit
that referenced
this pull request
May 21, 2026
JessicaJiang-123
pushed a commit
to JessicaJiang-123/sglang
that referenced
this pull request
Jun 21, 2026
nanjiangwill
pushed a commit
to nanjiangwill/sglang
that referenced
this pull request
Jul 7, 2026
XinyuJiangCMU
pushed a commit
to XinyuJiangCMU/sglang
that referenced
this pull request
Jul 17, 2026
…#25196) Re-applied onto v0.5.15's rewritten kimik2_detector: capture the model-emitted id at both ToolCallItem sites (streaming gated on the name-carrying delta), add KimiK2RawIdDetector + registry + serving_chat branch.
yueming-yuan
pushed a commit
that referenced
this pull request
Jul 25, 2026
yueming-yuan
pushed a commit
that referenced
this pull request
Jul 25, 2026
yueming-yuan
pushed a commit
that referenced
this pull request
Jul 25, 2026
yueming-yuan
pushed a commit
that referenced
this pull request
Jul 25, 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.
Motivation
The default kimi_k2 path renumbers ids via
history_tool_calls_cnt + tool_indexin the serving layer so that multi-turn conversations get globally unique, monotonically increasing ids (see PR #10600). That is the right behavior for chat use cases.However, RL training has the opposite requirement: the trajectory must round-trip the exact tool_call_id the model produced (e.g.
functions.foo:5), so that the follow-up tool result turn references the same id the policy emitted. This subclass exists purely as a marker so the serving layer can branch on the parser name and useToolCallItem.tool_call_iddirectly. Parsing logic is identical to KimiK2Detector.Modifications
Add a new KimiK2RawIdDetector to tool call parser, distinguished from original
kimi_k2tool call parser.Accuracy Tests
Speed Tests and Profiling
Checklist
Review and Merge Process
/tag-and-rerun-ci,/tag-run-ci-label,/rerun-failed-ci