fix(tool_parser): support XML function_call and tool_call with invoke_name and parameters - #671
Conversation
There was a problem hiding this comment.
All reported issues were addressed across 2 files
You’re at about 90% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
There was a problem hiding this comment.
All reported issues were addressed across 2 files (changes from recent commits).
You’re at about 90% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
…wen function openers
Fixes #670
Summary
During multi-turn tool-calling sessions with DeepSeek-V4 (e.g., autonomous coding agents), the model may output tool calls wrapped in XML
<function_call>or<tool_call>envelopes with<invoke_name>and<parameters>tags:Previously,
Pattern 4bandPattern 8intool_parser.cppdid not handle XML parameter blocks, leading toparse_tool_callsreturning 0 calls, suppressing buffered tool text, and emitting an empty stop response to the client.Changes
parse_xml_tool_call_body()inserver/src/server/tool_parser.cpp:<invoke_name>,<name>,<tool_name>,<function_name>, or<invoke name="...">.<parameters>or<arguments>sections (supporting element tags<key>val</key>and attribute style<parameter name="key">val</parameter>).parse_xml_tool_call_body()intoPattern 4b(<function_call>) andPattern 8(<tool_call>).server/test/test_server_unit.cppcovering single and multi-argument XML function/tool calls.Verification
test_server_unit: 426/426 passed.