Repository navigation
[Fix] minimax-m3: Type nested tool-call arguments and count self-opened reasoning - #46133
Merged
Merged
Conversation
Co-authored-by: Yuhao Yang <47235274+yhyang201@users.noreply.github.com> Co-authored-by: Xinyuan Tong <xinyuantong.cs@gmail.com> Co-authored-by: Yan Huang <yan.huang@radixark.ai>
ispobock
requested review from
JustinTong0323,
Ying1123,
hnyls2002,
merrymercy and
xiezhq-hermann
as code owners
October 23, 2026 17:38
Collaborator
Author
|
/rerun-test --changed |
Contributor
|
🚀 |
Collaborator
Author
|
/rerun-test --changed |
Contributor
|
🚀 |
Collaborator
Author
|
/rerun-test --changed |
Contributor
|
🚀 |
sherlockwu
pushed a commit
that referenced
this pull request
Oct 25, 2026
…alizer now does Since #46133, Python's `Function` keeps the client's key order and drops an unset `strict` or `defer_loading`, so a Jinja template no longer sees `"strict": false` added to every tool.
sherlockwu
pushed a commit
that referenced
this pull request
Oct 26, 2026
…lizer now does Since #46133, Python's `Function` keeps the client's key order and leaves out an unset `strict` or `defer_loading` (a null `strict` included), so GLM-5.3 and Qwen3.8 templates no longer see `"strict": false` added to every tool. One `function_dump` now serves their renderers and the template fallback; Kimi K3's dump accepts a null `strict` too. Regenerated the GLM-5.3 and Qwen3.8 parity fixtures from current Python; their prompts change only in tool cases (other changes are error wording). The fixture generator's stub server gains `is_minimax_m3`.
sherlockwu
pushed a commit
that referenced
this pull request
Oct 26, 2026
…okens_details Since #46133, Python's UsageProcessor also reports the reasoning count where OpenAI puts it, `usage.completion_tokens_details.reasoning_tokens` (null without reasoning), for chat and completions, unary and streamed. Regenerated the GLM-5.3 and Qwen3.8 OpenAI fixtures from current Python, keeping their recorded engine outputs; their tool cases' /generate ids also take the new tool dump. The generator's stub template owner gains the model config `load_chat_template` now reads.
sherlockwu
pushed a commit
that referenced
this pull request
Oct 26, 2026
…alizer now does Since #46133, Python's `Function` keeps the client's key order and drops an unset `strict` or `defer_loading`, so a Jinja template no longer sees `"strict": false` added to every tool.
sherlockwu
pushed a commit
that referenced
this pull request
Oct 26, 2026
…lizer now does Since #46133, Python's `Function` keeps the client's key order and leaves out an unset `strict` or `defer_loading` (a null `strict` included), so GLM-5.3 and Qwen3.8 templates no longer see `"strict": false` added to every tool. One `function_dump` now serves their renderers and the template fallback; Kimi K3's dump accepts a null `strict` too. Regenerated the GLM-5.3 and Qwen3.8 parity fixtures from current Python; their prompts change only in tool cases (other changes are error wording). The fixture generator's stub server gains `is_minimax_m3`.
sherlockwu
pushed a commit
that referenced
this pull request
Oct 26, 2026
…okens_details Since #46133, Python's UsageProcessor also reports the reasoning count where OpenAI puts it, `usage.completion_tokens_details.reasoning_tokens` (null without reasoning), for chat and completions, unary and streamed. Regenerated the GLM-5.3 and Qwen3.8 OpenAI fixtures from current Python, keeping their recorded engine outputs; their tool cases' /generate ids also take the new tool dump. The generator's stub template owner gains the model config `load_chat_template` now reads.
sherlockwu
pushed a commit
that referenced
this pull request
Oct 26, 2026
…alizer now does Since #46133, Python's `Function` keeps the client's key order and drops an unset `strict` or `defer_loading`, so a Jinja template no longer sees `"strict": false` added to every tool.
sherlockwu
pushed a commit
that referenced
this pull request
Oct 26, 2026
…lizer now does Since #46133, Python's `Function` keeps the client's key order and leaves out an unset `strict` or `defer_loading` (a null `strict` included), so GLM-5.3 and Qwen3.8 templates no longer see `"strict": false` added to every tool. One `function_dump` now serves their renderers and the template fallback; Kimi K3's dump accepts a null `strict` too. Regenerated the GLM-5.3 and Qwen3.8 parity fixtures from current Python; their prompts change only in tool cases (other changes are error wording). The fixture generator's stub server gains `is_minimax_m3`.
sherlockwu
pushed a commit
that referenced
this pull request
Oct 26, 2026
…okens_details Since #46133, Python's UsageProcessor also reports the reasoning count where OpenAI puts it, `usage.completion_tokens_details.reasoning_tokens` (null without reasoning), for chat and completions, unary and streamed. Regenerated the GLM-5.3 and Qwen3.8 OpenAI fixtures from current Python, keeping their recorded engine outputs; their tool cases' /generate ids also take the new tool dump. The generator's stub template owner gains the model config `load_chat_template` now reads.
sherlockwu
pushed a commit
that referenced
this pull request
Oct 26, 2026
…alizer now does Since #46133, Python's `Function` keeps the client's key order and drops an unset `strict` or `defer_loading`, so a Jinja template no longer sees `"strict": false` added to every tool.
sherlockwu
pushed a commit
that referenced
this pull request
Oct 26, 2026
…lizer now does Since #46133, Python's `Function` keeps the client's key order and leaves out an unset `strict` or `defer_loading` (a null `strict` included), so GLM-5.3 and Qwen3.8 templates no longer see `"strict": false` added to every tool. One `function_dump` now serves their renderers and the template fallback; Kimi K3's dump accepts a null `strict` too. Regenerated the GLM-5.3 and Qwen3.8 parity fixtures from current Python; their prompts change only in tool cases (other changes are error wording). The fixture generator's stub server gains `is_minimax_m3`.
sherlockwu
pushed a commit
that referenced
this pull request
Oct 26, 2026
…okens_details Since #46133, Python's UsageProcessor also reports the reasoning count where OpenAI puts it, `usage.completion_tokens_details.reasoning_tokens` (null without reasoning), for chat and completions, unary and streamed. Regenerated the GLM-5.3 and Qwen3.8 OpenAI fixtures from current Python, keeping their recorded engine outputs; their tool cases' /generate ids also take the new tool dump. The generator's stub template owner gains the model config `load_chat_template` now reads.
sherlockwu
pushed a commit
that referenced
this pull request
Oct 26, 2026
…alizer now does Since #46133, Python's `Function` keeps the client's key order and drops an unset `strict` or `defer_loading`, so a Jinja template no longer sees `"strict": false` added to every tool.
sherlockwu
pushed a commit
that referenced
this pull request
Oct 26, 2026
…lizer now does Since #46133, Python's `Function` keeps the client's key order and leaves out an unset `strict` or `defer_loading` (a null `strict` included), so GLM-5.3 and Qwen3.8 templates no longer see `"strict": false` added to every tool. One `function_dump` now serves their renderers and the template fallback; Kimi K3's dump accepts a null `strict` too. Regenerated the GLM-5.3 and Qwen3.8 parity fixtures from current Python; their prompts change only in tool cases (other changes are error wording). The fixture generator's stub server gains `is_minimax_m3`.
sherlockwu
pushed a commit
that referenced
this pull request
Oct 26, 2026
…okens_details Since #46133, Python's UsageProcessor also reports the reasoning count where OpenAI puts it, `usage.completion_tokens_details.reasoning_tokens` (null without reasoning), for chat and completions, unary and streamed. Regenerated the GLM-5.3 and Qwen3.8 OpenAI fixtures from current Python, keeping their recorded engine outputs; their tool cases' /generate ids also take the new tool dump. The generator's stub template owner gains the model config `load_chat_template` now reads.
13 tasks done
6 tasks done
Rockdu
added a commit
to radixark/miles
that referenced
this pull request
Oct 31, 2026
…he parity test SGLang v0.5.23 keeps the client's tool key order with strict unset (sgl-project/sglang#46133), and its Anthropic converter now writes name, description, parameters and strict (sgl-project/sglang#45254). The OpenAI side of the Anthropic/OpenAI parity test must spell tools the way the codec does for the two routes to render identical input_ids. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rockdu
added a commit
to radixark/miles
that referenced
this pull request
Oct 31, 2026
The V4 encoder renders each tool dict verbatim, and the bridge built those dicts with sglang's Tool.model_dump(). SGLang v0.5.23 (sgl-project/sglang#46133) made Function keep the client's key order and drop an unset strict, so even with the vendored encoder every tool-bearing V4 prompt changed. dsv4_tool_payload rebuilds the v0.5.22 shape (declared order, strict defaulting to False). V4.1 already sends its own payload, and V3.2 keeps following Tool.model_dump(), which sglang's dsv32 serving path also uses. Checked by rendering 108 V4 and 108 V4.1 cases (tool spellings, system and tool turns, thinking on/off, generation prompt on/off) with miles main on the old stack and with this branch on the new one: identical, where V4 differed in all 96 tool-bearing cases before this change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4 of 5 tasks
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.
Summary
Fixes in the MiniMax-M3 tool-call parser and chat serving: type tool-call arguments nested in schema-less containers, and count reasoning tokens when the model opens the reasoning block itself.
Changes to existing code
These apply to every model:
Function.strictdefaults toNoneand is left out of the rendered tool schema when unset; it wasFalseand always injected.detailof"default"is read as"auto".rootrole is accepted alongsidesystemanddeveloper.thinkingrequest field is accepted; only chat templates that define a thinking mode read it.completion_tokens_details.reasoning_tokens, set only when there are some.ModelConfig.self_opened_think_start_idsdefaults toNone; the scheduler fills it only when a reasoning parser is configured.MiniMax-M3 only: the request's own
thinking,reasoning_effortandchat_template_kwargssettlethinking_modeand the effort before--default-chat-template-kwargsfill what the request left unset, so a server default never re-enables thinking the request turned off.Verification
Cut byte-for-byte from #45925 (MiniMax-M3.1-Flash support) at 10e655a.
CI States
Latest PR Test (Base): 🚫 Run #40090965301
Latest PR Test (Extra): ❌ Run #40090965282
Latest PR Test (AMD ROCm 10): 🚫 Run #40090965289