Skip to content

fix: assemble Anthropic streamed tool_use blocks before replay - #7026

Closed
lorenzozanee wants to merge 1 commit into
1Panel-dev:v2from
lorenzozanee:fix/anthropic-tool-use-streaming
Closed

lorenzozanee wants to merge 1 commit into
1Panel-dev:v2from
lorenzozanee:fix/anthropic-tool-use-streaming

Conversation

@lorenzozanee

Copy link
Copy Markdown

What this PR does / why we need it?

Anthropic streamed tool arguments were replayed as input_json_delta content blocks, which the Messages API rejects. This change assembles the fragments into completed tool_use.input blocks before replay and removes empty text blocks while preserving existing compatible tool-call handling.

Summary of your change

Fixes #6480 by normalizing Anthropic streamed tool content in the flow response handler.

Reviewers

@shaohuzhang1, @liuruibin, and @liqiang-fit2cloud

Please indicate you've done the following:

  • Made sure tests are passing and test coverage is added if needed.
  • Made sure commit message follow the rule of Conventional Commits specification.
  • Considered the docs impact and opened a new docs issue or PR with docs changes if needed.

@lorenzozanee lorenzozanee closed this by deleting the head repository Sep 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant