Pull requests / #787
#787 fix: parse tool calls inside reasoning
closed · @kossum · 0 评论 · 在 GitHub 查看
描述
I have been running into agent turns that stop after thinking, with no answer or tool call. One case is when the model writes a complete before closing . The parser treats it as reasoning text, so the client never gets the call. This patch lets the reasoning state use the existing tool-call parser too. After the call, it goes back to reasoning until arrives. It also keeps partial `<tool_call>` tags buffered when they're split across chunks. This only handles the tool fragment being swallowed. It doesn't change stop tokens or try to continue a reply that contains nothing but reasoning. ## Tests `python -m unittest serve.test_reasoning_tools` passes. Covers tool calls in reasoning and normal content, tags split across chunks, and unfinished calls. These checks ran in a Linux Docker container with Python 3.12. They don't include a GPU inference test.
站内延伸阅读
链到安装、模型与版本说明,便于 SEO/GEO,非官方 issue 正文。