Skip to content

[Inference] Make the tool-call implicit reasoning end opt-in - #7313

Closed
ArEsKay3 wants to merge 2 commits into
NVIDIA:mainfrom
ArEsKay3:rkirby/qwen3-coder-tool-combined
Closed

ArEsKay3 wants to merge 2 commits into
NVIDIA:mainfrom
ArEsKay3:rkirby/qwen3-coder-tool-combined

Conversation

@ArEsKay3

@ArEsKay3 ArEsKay3 commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor
  • I, the PR author, have personally reviewed every line of this PR.

What does this PR do?

#6411 made qwen3-coder-tool declare <tool_call> an implicit end of reasoning, so a tool call emitted before </think> is split out of the reasoning text and parsed. That matches vLLM's combined qwen3 parser engine, but not vLLM's standalone reasoning parsers (deepseek_r1 and subclasses) paired with the qwen3_coder tool parser, which leave such a tool call inside reasoning_content. Serving the same model on both engines with a separate reasoning parser now yields different tool calls, and RL rewards that penalise an unparsed <tool_call> see the two engines disagree.

This keeps qwen3-coder-tool strict, matching the separate-parser pairing, and adds qwen3-coder-tool-combined carrying the marker for callers who want the combined-engine behaviour. The choice is made in the parser list, where it is visible in the server config, rather than implied by which tool parser is loaded. Streaming markers are unchanged on both.

Issue tracking

Linked issue: none. Follow-up to #6411.

Contribution process

Pre-checks

  • I have added relevant unit tests
  • I have added relevant functional tests
  • I have added proper typing to my code Typing guidelines
  • I have added relevant documentation
  • I have run the autoformatter.sh on my PR

NVIDIA#6411 made qwen3-coder-tool declare <tool_call> an implicit end of
reasoning, so a tool call emitted before </think> is split out of the
reasoning text and parsed. That matches vLLM's combined qwen3 parser but
not its standalone reasoning parsers paired with the qwen3_coder tool
parser, which leave such a tool call in reasoning_content. Serving the
same model on both engines with a separate reasoning parser now yields
different tool calls.

Keep qwen3-coder-tool strict and add qwen3-coder-tool-combined carrying
the marker, so the behaviour is chosen in the parser list. Streaming
markers are unchanged on both.

Signed-off-by: Robert Kirby <rkirby@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Sep 14, 2026

Copy link
Copy Markdown

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@sidsingh-nvidia
sidsingh-nvidia marked this pull request as ready for review September 17, 2026 00:17
@sidsingh-nvidia
sidsingh-nvidia requested review from a team as code owners September 17, 2026 00:17
@sidsingh-nvidia

Copy link
Copy Markdown
Contributor

/ok to test 9a6e2c7

sidsingh-nvidia pushed a commit to sidsingh-nvidia/Megatron-LM that referenced this pull request Sep 17, 2026
PR NVIDIA#6411 made qwen3-coder-tool declare <tool_call> an implicit end of
reasoning, so a tool call emitted before </think> is split out of the
reasoning text and parsed. That matches vLLM's combined qwen3 parser but
not its standalone reasoning parsers paired with the qwen3_coder tool
parser, which leave such a tool call in reasoning_content. Serving the
same model on both engines with a separate reasoning parser now yields
different tool calls.

Keep qwen3-coder-tool strict and add qwen3-coder-tool-combined carrying
the marker, so the behaviour is chosen in the parser list. Streaming
markers are unchanged on both.

Folded into the Qwen3-Coder parser-parity branch alongside the grammar and
coercion parity fixes (NVIDIA#7320); relevant to NVIDIA#7313.

Signed-off-by: Robert Kirby <rkirby@nvidia.com>
(cherry picked from commit c09b3fe)
Signed-off-by: Siddharth Singh <sidsingh@nvidia.com>
sidsingh-nvidia pushed a commit to sidsingh-nvidia/Megatron-LM that referenced this pull request Sep 18, 2026
PR NVIDIA#6411 made qwen3-coder-tool declare <tool_call> an implicit end of
reasoning, so a tool call emitted before </think> is split out of the
reasoning text and parsed. That matches vLLM's combined qwen3 parser but
not its standalone reasoning parsers paired with the qwen3_coder tool
parser, which leave such a tool call in reasoning_content. Serving the
same model on both engines with a separate reasoning parser now yields
different tool calls.

Keep qwen3-coder-tool strict and add qwen3-coder-tool-combined carrying
the marker, so the behaviour is chosen in the parser list. Streaming
markers are unchanged on both.

Folded into the Qwen3-Coder parser-parity branch alongside the grammar and
coercion parity fixes (NVIDIA#7320); relevant to NVIDIA#7313.

Signed-off-by: Robert Kirby <rkirby@nvidia.com>
(cherry picked from commit c09b3fe)
Signed-off-by: Siddharth Singh <sidsingh@nvidia.com>
@sidsingh-nvidia

Copy link
Copy Markdown
Contributor

Merged as a part of #7320. Closing.

This branch was previously deployed

2 inactive deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants