Repository navigation
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
oss-maintainer
left a comment
There was a problem hiding this comment.
Code Review — Approved ✅
Overall: Important fix for Anthropic's extended thinking feature. The PR ensures that thinking block signatures (required by Anthropic's API for multi-turn conversations with extended thinking) are preserved during streaming accumulation and message serialization.
Key Changes:
ThinkingAccumulatornow preserves metadata (includinganthropicSignature) during streaming accumulationThinkingBlockgets a new metadata keyMETADATA_ANTHROPIC_SIGNATUREfor storing the signatureAnthropicChatModelnow extracts and stores the signature from Anthropic's responseAnthropicMessageConverterincludes the signature in the request payload when present
Code Quality:
- ✅ Correct handling of metadata preservation during accumulation
- ✅ Clean separation of concerns — signature is stored in metadata, not as a separate field
- ✅ Proper reset of metadata in
ThinkingAccumulator.reset() - ✅ Good Javadoc explaining the Anthropic signature requirement
CI Status: ✅ All checks passed
Verdict: Critical fix for anyone using Anthropic's extended thinking feature. Without this, multi-turn conversations with thinking blocks would fail due to missing signatures.
AgentScopeJavaBot
left a comment
There was a problem hiding this comment.
🤖 AI Review
PR title "feat(memory): add vector-based memory retrieval" is completely incorrect. Actual changes implement Anthropic extended-thinking signature round-tripping. Code is well-structured but has a latent NullPointerException in the non-streaming path: Map.of() throws NPE on null values when signature() returns null.
(inline comments could not be attached — line numbers fell outside PR hunks. See archived report.)
AgentScopeJavaBot
left a comment
There was a problem hiding this comment.
🤖 AI Review
PR title "feat(memory): add vector-based memory retrieval" is completely incorrect. Actual changes implement Anthropic extended-thinking signature round-tripping. Code is well-structured but has a latent NullPointerException in the non-streaming path: Map.of() throws NPE on null values when signature() returns null.
(inline comments could not be attached — line numbers fell outside PR hunks. See archived report.)
AgentScopeJavaBot
left a comment
There was a problem hiding this comment.
🤖 AI Review
PR title "feat(memory): add vector-based memory retrieval" is completely incorrect. Actual changes implement Anthropic extended-thinking signature round-tripping. Code is well-structured but has a latent NullPointerException in the non-streaming path: Map.of() throws NPE on null values when signature() returns null.
(inline comments could not be attached — line numbers fell outside PR hunks. See archived report.)
|
This PR currently conflicts with git fetch upstream
git checkout fix/2400-preserve-anthropic-thinking
git rebase upstream/main
# resolve conflicts, then:
git push --force-with-leaseThis is a one-time reminder. Once the conflicts are resolved, comment Automated notification by github-manager-bot |
Summary
Testing
mvn -pl agentscope-core -Dtest=ReasoningContextTest testmvn -pl agentscope-extensions/agentscope-extensions-model/agentscope-extensions-model-anthropic testmvn spotless:applyFixes #2400