mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #787] [CLOSED] fix: parse tool calls inside reasoning #2827
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#2827
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/787
Author: @kossum
Created: 10/4/2026
Status: ❌ Closed
Base:
main← Head:fix/reasoning-tool-calls📝 Commits (1)
ff25a48fix: parse tool calls inside reasoning📊 Changes
2 files changed (+47 additions, -3 deletions)
View changed files
📝
serve/frontend.py(+13 -3)➕
serve/test_reasoning_tools.py(+34 -0)📄 Description
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_toolspasses. 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.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.