mudler / mudler/vllm.cpp

fix(TOOLS-STREAMING-PARSER): an Inkling response with no thinking block never emits REASONING_END

Open
#2,652 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
423
Forks
53
Avg merge
20h 26m
Merged PRs (30d)
310

Description

Row: TOOLS-STREAMING-PARSER

Found by #2647 (PORT-NOW wave
PORTQ-3, tranche 81-120). Nothing was executed: this is a static reading of the
tree at e24ec8bfd against upstream 1c1077c6cc (vllm#49876) and 0820125ae9
(vllm#50528), both read with git show at their revisions.

This issue covers two queue entries, because they are the same defect in the
same table and a porter would land them together. It is deliberately not two
issues over eight adjacent map keys.

What is missing

An Inkling response that opens a content block or a tool call without ever
having opened a thinking block
never emits REASONING_END. Upstream fixed this
in two steps, and this tree carries the pre-fix state of both.

1c1077c6cc adds REASONING_END to six transitions. All six are {} here, in
src/vllm/parser/engine/configs.cpp:

key line
{CONTENT, TEXT_START} :979
{CONTENT, TOOL_TEXT} :982
{CONTENT, TOOL_ERROR} :983
{MESSAGE_HEADER, TEXT_START} :985
{MESSAGE_HEADER, TOOL_TEXT} :990
{MESSAGE_HEADER, TOOL_ERROR} :991

0820125ae9 adds it ahead of TOOL_CALL_START on the two TOOL_START
transitions. Both read Transition(S::TOOL_ARGS, {E::TOOL_CALL_START}) here:
:981 ({CONTENT, TOOL_START}) and :988-989 ({MESSAGE_HEADER, TOOL_START}).

For contrast, the transition that already carries it is :993-994
({REASONING, TOOL_START}{REASONING_END, TOOL_CALL_START}) — the path where
a thinking block was open. That is the asymmetry both commits remove.

Reachable

This is on the ordinary apply_transition path
(src/vllm/parser/engine/streaming_parser_engine.cpp:317-342), not a skipped
one. --tool-call-parser inkling reaches it through get_parser_engine from
src/vllm/entrypoints/openai/serving_chat.cpp:564, and the assembly layer
consumes the event at src/vllm/parser/engine/parser_engine.cpp:461-463 and
:908-909, where it backs is_reasoning_end.

Size

~8 lines in configs.cpp plus ported scenarios in
tests/vllm/parser/engine/test_parser_engine_assembly.cpp. 0820125ae9 also
reorders the header exit in the skip_tool_parsing branch of
streaming_parser_engine.cpp:269-284; land that in the same change so the block
is not reopened, but see the ordering note below.

Ordering, and what this does NOT overlap

  • Distinct from #2637. That
    gap is configs.cpp:1002 ({MESSAGE_HEADER, block-end}) plus emit_for_state,
    content_events and finish(). Different map keys, no double count. All four
    of its anchors were re-verified unchanged at e24ec8bfd while filing this.
  • Unrelated to #2638.
  • The streaming half touches the same block as upstream 75231eff2f (vllm#51391),
    which this wave classified NOT_APPLICABLE — inert because
    skip_tool_parsing is only ever true for the qwen3 config today (its only
    setter is
    src/vllm/entrypoints/openai/reasoning_parsers/parser_engine_adapter.cpp:29,
    and the only registered adapter is Qwen3ParserReasoningAdapter,
    reasoning_parsers/abstract.cpp:64-66). If an Inkling or MiniMax reasoning
    adapter is ever registered, port 75231eff2f before this issue's streaming
    half — upstream order — or the header-exit reorder lands on a block that has
    not yet grown its tool-exit terminals.

Read before writing the reachability mutation

#695 reports that engine-backed
tool parsers run with skip_special_tokens=true, stripping structural markers
before the parser engine sees them. If that still holds, these events are
reachable by construction but may be unobservable end to end. It does not change
the gap; it changes what a green test would be proving.

Not in scope here

This issue does not advance the parity pin. Both commits are inside the
5559679229..e126687a9a window that #2611
owns.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the listed transitions in src/vllm/parser/engine/configs.cpp and trace apply_transition in streaming_parser_engine.cpp, then read the related assembly points and issue #695. Run the ported scenarios in tests/vllm/parser/engine/test_parser_engine_assembly.cpp. Done means no-thinking Inkling content and tool paths emit REASONING_END without reopening the block, including the skip_tool_parsing path.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.