Skip to content

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

Open
lorenzozanee wants to merge 1 commit into
1Panel-dev:v2from
lorenzozanee:restore/pr-7026
Open

lorenzozanee wants to merge 1 commit into
1Panel-dev:v2from
lorenzozanee:restore/pr-7026

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.

Supersedes #7026(原PR分支已删,按原提交重建)

@liuruibin

Copy link
Copy Markdown
Member

我们已经没有可用的Anthropic账号了,无法有效验证这个bugfix。其次test部分不用包含到源码当中

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

Projects

None yet

2 participants