Skip to content

feat(anthropic): support extended thinking round trips#2233

Open
dailingtao wants to merge 6 commits into
agentscope-ai:mainfrom
dailingtao:codex/issue-2219-anthropic-thinking
Open

feat(anthropic): support extended thinking round trips#2233
dailingtao wants to merge 6 commits into
agentscope-ai:mainfrom
dailingtao:codex/issue-2219-anthropic-thinking

Conversation

@dailingtao

@dailingtao dailingtao commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #2219.

  • map GenerateOptions.thinkingBudget to Anthropic budget_tokens
  • preserve Anthropic thinking signatures and redacted thinking blocks in ThinkingBlock metadata
  • restore those native blocks, in their original order, when conversation history is sent back to Anthropic
  • preserve provider metadata while streaming thinking chunks are accumulated by ReasoningContext
  • keep the existing text fallback for unsigned or malformed provider-specific ThinkingBlock metadata
  • document Anthropic extended-thinking configuration in English and Chinese

Validation

  • mvn -pl agentscope-extensions/agentscope-extensions-model/agentscope-extensions-model-anthropic -am clean verify
  • AgentScope Core: 2214 tests, 0 failures, 0 errors, 9 skipped
  • Anthropic model extension: 151 tests, 0 failures, 0 errors, 1 skipped

@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

@AgentScopeJavaBot AgentScopeJavaBot added enhancement New feature or request area/core/model Model providers and formatters area/ext/integration External protocols & middleware integrations labels Jul 16, 2026

@AgentScopeJavaBot AgentScopeJavaBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Review

Aspect Count
🟢 Nitpick (信息性建议,不阻塞合并) 3
🟡 Recommended (建议修复,但不阻塞合并) 2

Overall Assessment: COMMENT — Well-designed extended thinking round-trip support; two defensive-programming improvements recommended before merge.

@AgentScopeJavaBot AgentScopeJavaBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Review

Aspect Count
🟢 Nitpick (信息性建议,不阻塞合并) 3
🟡 Recommended (建议修复,但不阻塞合并) 2

Overall Assessment: COMMENT — Well-designed extended thinking round-trip support; two defensive-programming improvements recommended before merge.

@dailingtao

Copy link
Copy Markdown
Contributor Author

Hi @jujn, it looks like AgentScopeJavaBot may be stuck on this PR.

The bot submitted the same review summary twice for commit d7f6dea4,
reporting 3 nitpicks and 2 recommendations, but no inline comments or
review threads were created, so I couldn't see the specific findings.

The latest head is now 1bcd3d7c, and the new review request is still
pending. I also don't have permission to re-request reviewers.

Could you please help re-trigger the AI review or check whether the bot
service is working correctly?

All current CI checks are passing. Thanks!

@jujn

jujn commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

Thanks for your contribution. I'll review it later when I have time.

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

Labels

area/core/model Model providers and formatters area/ext/integration External protocols & middleware integrations enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Anthropic 推理增强

3 participants