Skip to content

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

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

feat(anthropic): support extended thinking round trips#2233
dailingtao wants to merge 4 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 ThinkingBlocks from other providers
  • 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: 150 tests, 0 failures, 0 errors, 1 skipped
  • local JaCoCo estimate for added executable lines: 129/134 (96.3%)

@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.

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 推理增强

2 participants