Repository navigation
Recover GLM-4.7 tool calls missing arg_key start - #47190
Tib-Gridello wants to merge 1 commit into
Conversation
76a6347 to
aa428e6
Compare
Signed-off-by: tibG <tib.gridello@gmail.com>
aa428e6 to
135c874
Compare
|
Box3 validation note: the deployed vLLM image still uses the older This PR's parser-engine implementation avoids the old early-return behavior and recovers by splitting the longest valid tool name from the accumulated name+args text. That is the behavior we need upstream so the API does not emit invalid tool names before application-layer repair. |
|
This pull request has merge conflicts that must be resolved before it can be |
Summary
tool_namearg</arg_key>instead oftool_name<arg_key>arg</arg_key>Context
This is separate from #47146. That PR enables required/named tool-choice when strict tool calling is disabled; it does not repair malformed structural tag output where the opening
<arg_key>token is missing.Observed malformed examples from a GLM-4.7-compatible serving setup include:
<tool_call>send_command_to_shellcommand</arg_key><arg_value>echo test</arg_value></tool_call><tool_call>grep_toolpattern</arg_key><arg_value>...</arg_value></tool_call><tool_call>browser_action task</arg_key><arg_value>...</arg_value></tool_call>Verification
python3 -m py_compile vllm/parser/glm47_moe.py tests/tool_parsers/test_glm47_moe_tool_parser.pyCould not run the targeted pytest suite locally because the repository uv environment does not resolve on this macOS environment due the pinned Torch split, and
pytestis not installed in the no-sync environment.