Skip to content

fix(flow): detect tool calls after streamed text - #1141

Open
ruirui6946 wants to merge 1 commit into
cloudwego:mainfrom
ruirui6946:codex/fix-stream-tool-call-detection
Open

fix(flow): detect tool calls after streamed text#1141
ruirui6946 wants to merge 1 commit into
cloudwego:mainfrom
ruirui6946:codex/fix-stream-tool-call-detection

Conversation

@ruirui6946

Copy link
Copy Markdown

Summary

  • scan streamed model output until a tool call or EOF
  • apply the same default checker behavior to ReAct and host multi-agent
  • update configuration docs and add regression coverage for text-before-tool-call streams

Why

Some models emit text or reasoning chunks before the tool-call chunk. The previous default checker stopped at the first non-empty text chunk, so the agent incorrectly ended instead of executing the tool.

Fixes #892

Validation

  • go test ./flow/agent/react ./flow/agent/multiagent/host
  • go test ./flow/agent/...

@CLAassistant

CLAassistant commented Jul 14, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

react: streaming tool-call detection fails when model emits text before tool-call chunks

2 participants