Skip to content

add a shared Qwen tool/reasoning parser table so runtimes stop copying the wrong spelling - #4812

Merged
atomantic merged 1 commit into
mainfrom
claim/issue-4778
Aug 22, 2026
Merged

add a shared Qwen tool/reasoning parser table so runtimes stop copying the wrong spelling#4812
atomantic merged 1 commit into
mainfrom
claim/issue-4778

Conversation

@atomantic

Copy link
Copy Markdown
Owner

Summary

  • Adds server/lib/qwenAgentParsers.js — the one table of tool-call / reasoning parser launch flags each local runtime needs to serve a Qwen3-family model to a coding agent. vLLM qwen3_xml (plus --enable-auto-tool-choice, without which vLLM 400s every tool request), SGLang qwen3_coder + --reasoning-parser qwen3, llama both null — a positive "no equivalent flag today", not a placeholder.
  • parserFlagsFor(runtime) returns the argv fragment (always an array, so no caller type-checks the return), vllmExtraArgs() its string form for the compose project's .env EXTRA_ARGS. An unknown runtime throws — the failure this prevents is silent: a parser-less server answers fluently and returns tool markup as ordinary text with tool_calls: null, so the agent never touches a file.
  • Guard test fails if any other tracked source file hard-codes a qwen3_* spelling, and a snapshot test pins the docs/features/qwen38-rtx3090.md EXTRA_ARGS line to the table so doc and code cannot drift. Doc gets a pointer at the table.
  • Barrel + server/lib/README.md row per the module-organization rule.

Two implementation calls made in the issue's spirit rather than re-litigated: parserFlagsFor returns an array for every runtime (vLLM's string transport is vllmExtraArgs(), so no caller does a typeof check), and the row carries a third enableAutoToolChoice key because the parser flag alone still kills a vLLM session on the agent's first turn.

Out of scope, untouched: the SGLang runtime (#4776) and the vLLM guided install (#4767). Both are told to import this table instead of retyping the string.

Test plan

  • cd server && npm test — 1566 files / 32825 tests pass, including the new lib/qwenAgentParsers.test.js (spelling pins for both runtimes, throw-on-unknown, prototype-key probe, doc snapshot, cross-repo grep guard) and lib/index.test.js barrel + README parity.
  • Local reviewer pass (antigravity, gemini-3.7-flash, effort medium) on the branch diff: no findings.

Closes #4778

…g the wrong spelling (#4778)

Every local engine that serves a Qwen3-family model to a coding agent needs a
runtime-specific tool-call parser, and on engines that split reasoning, a
reasoning parser. The spellings differ per runtime and the failure is silent:
the server starts, the model answers, tool markup comes back as ordinary
assistant text with tool_calls: null, and the agent never touches a file.

Those spellings lived only in prose — vLLM's qwen3_xml in the 3090 feature doc,
SGLang's qwen3_coder + qwen3 in a research note — so the next runtime would copy
whichever doc ranked first. server/lib/qwenAgentParsers.js is now the one table:
parserFlagsFor(runtime) builds the argv fragment, vllmExtraArgs() the .env string
form, and an unknown runtime throws rather than launching parser-less. llama's
all-null row is a decision (llama-server has no equivalent flag today), not a
placeholder.

A guard test fails if any other tracked source file hard-codes a qwen3_* parser
spelling, and a snapshot test pins the 3090 doc's EXTRA_ARGS line to the table so
the two cannot drift. The SGLang runtime (#4776) and the vLLM guided install
(#4767) consume this instead of retyping the string.
@atomantic
atomantic merged commit 28427a2 into main Aug 22, 2026
7 checks passed
@atomantic
atomantic deleted the claim/issue-4778 branch August 22, 2026 04:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Encode Qwen-family tool/reasoning parsers in a shared launch-flag table

1 participant