Skip to content

fix: report the end of reasoning when the model starts calling - #955

Merged
alcholiclg merged 2 commits into
modelscope:mainfrom
alcholiclg:fix/reasoning-timer
Aug 31, 2026
Merged

fix: report the end of reasoning when the model starts calling#955
alcholiclg merged 2 commits into
modelscope:mainfrom
alcholiclg:fix/reasoning-timer

Conversation

@alcholiclg

Copy link
Copy Markdown
Collaborator

Change Summary

  • Problem: ReasoningEnded fired only on the first content token or when the stream drained. Reasoning-to-tool rounds have no content token, so it waited for all tool arguments—up to a minute for a whole file.
  • Fix:Close the reasoning block at the first named tool call. The name arrives before its arguments and uses the same boundary check as _emit_tool_composing, consistent with the existing content path.

Related issue number

Checklist

  • The pull request title is a good summary of the changes - it will be used in the changelog
  • Unit tests for the changes exist
  • Run pre-commit install and pre-commit run --all-files before git commit, and passed lint check.
  • Documentation reflects the changes where applicable

@alcholiclg
alcholiclg merged commit eb85867 into modelscope:main Aug 31, 2026
1 check was pending
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.

2 participants