fix(muse-glimmer): parse required/named tool calls natively - #34781
Merged
Jiminator merged 2 commits intoAug 14, 2026
Merged
Conversation
Muse Glimmer only ever emits ATEM tool calls. With tool_choice=required or a named tool, the default path forces a JSON-array grammar (via JsonArrayParser) that the model does not emit for tool calls; when it produces its native ATEM block instead, the JSON parser cannot read it and the call leaks to the client as content with zero tool calls. Return True from parses_required_natively() so required/named decode through the native ATEM parser, the same path tool_choice=auto uses.
Collaborator
|
/tag-and-rerun-ci |
Collaborator
|
/tag-and-rerun-ci extra |
Jiminator
enabled auto-merge (squash)
August 14, 2026 10:28
Collaborator
|
/rerun-failed-ci |
saturn-acc
pushed a commit
to saturn-acc/sglang
that referenced
this pull request
Aug 16, 2026
…ect#34781) Co-authored-by: Xinyuan Tong <xinyuantong.cs@gmail.com>
Atituiset
pushed a commit
to Atituiset/sglang
that referenced
this pull request
Sep 10, 2026
…ect#34781) Co-authored-by: Xinyuan Tong <xinyuantong.cs@gmail.com>
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
Muse Glimmer only ever emits ATEM (
<atem:function_calls>) tool calls. Withtool_choice="required"or a named tool, the current path routes toJsonArrayParserand constrains generation with a JSON-array grammar. The modeldoes not emit that JSON format for tool calls, so when it produces its native ATEM block instead,
JsonArrayParsercannot parse it - the call leaks to the client ascontentwithfinish_reason="stop"and zerotool_calls.This reproduces on
main. It is deterministic on a turn whose message history already contains a prior assistanttool_callsturn (both streaming and non-streaming, at the default--stream-interval): the model opens a tool channel and writes native ATEM, which the JSON path drops.tool_choice="auto"is unaffected - it already parses the native ATEM throughMuseGlimmerDetector.Modifications
MuseGlimmerDetector.parses_required_natively()now returnsTrue. This routesrequired/namedtool_choicethrough the detector's native ATEM parsing - the same pathtool_choice="auto"already uses - instead of the JSON-array grammar. Single-file change; no other behavior is altered.Accuracy Tests
Verified before/after on
mainservingMuse-Glimmer-30B(BF16, single GPU),--tool-call-parser muse --reasoning-parser muse, default--stream-interval:auto(single + multi-turn)required/ named, single-turnrequired/ named, multi-turn (prior tool_calls turn)Existing
test/registered/unit/function_call/suite passes with the change.Speed Tests and Profiling
No inference-speed impact - the change only selects which parser handles the already-generated output for
required/namedtool_choice.Checklist
required/named path).CI States
Latest PR Test (Base): ❌ Run #31792190115
Latest PR Test (Extra): ✅ Run #31792189989