Skip to content

fix(anthropic): preserve thinking signatures - #2418

Open
logicwu0 wants to merge 2 commits into
agentscope-ai:mainfrom
logicwu0:fix/2400-preserve-anthropic-thinking
Open

fix(anthropic): preserve thinking signatures#2418
logicwu0 wants to merge 2 commits into
agentscope-ai:mainfrom
logicwu0:fix/2400-preserve-anthropic-thinking

Conversation

@logicwu0

Copy link
Copy Markdown
Contributor

Summary

  • preserve extended-thinking signatures in non-streaming and streaming responses
  • accumulate signature metadata with streamed thinking text
  • send signed thinking blocks back with the native Anthropic content type
  • skip unsigned thinking blocks instead of exposing them as ordinary text

Testing

  • mvn -pl agentscope-core -Dtest=ReasoningContextTest test
  • mvn -pl agentscope-extensions/agentscope-extensions-model/agentscope-extensions-model-anthropic test
  • mvn spotless:apply

Fixes #2400

@codecov

codecov Bot commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.22222% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...pe/core/agent/accumulator/ThinkingAccumulator.java 90.90% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

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.

[Bug]:AnthropicChatModel 将 ThinkingBlock 作为普通 text 传回 API,导致 400 错误

1 participant