Repository navigation
fix(anthropic): serialize non-streaming tool arguments as JSON - #4031
Merged
jujn merged 1 commit intoNov 7, 2026
Merged
Conversation
jujn
approved these changes
Nov 7, 2026
chickenlj
pushed a commit
that referenced
this pull request
Nov 13, 2026
Backport the verified fix to the 2.0.x implementation and retain its existing public contracts where the upstream kernel differs. (cherry picked from commit e473edb) Constraint: No AgentScope Service or SDK migration Confidence: high Not-tested: Whole-repository verification pending after lane integration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Non-streaming Anthropic tool responses set
ToolUseBlock.contentusingJsonValue.toString(). Non-empty arguments can become Java-style map text such as{store_id=S001, month=2026-10}instead of JSON. The agent accumulator rejects those arguments as malformed, so tools do not execute even though the API request succeeds.This independent bug was reported during validation of #4019: #4018 (comment). This PR is based on current upstream main and does not include or depend on #4019.
Changes
inputandcontentconsistent.Validation
mvn -T1C -pl agentscope-extensions/agentscope-extensions-model/agentscope-extensions-model-anthropic -am spotless:apply testpassed: core 2,993 tests (9 skipped), Anthropic 259 tests (1 existing skip), no failures/errors.spotless:checkandgit diff --checkpassed.deepseek-flashvia the official Anthropic-compatible endpoint,stream(false), thinking disabled. A complete ReActAgent run generated non-empty arguments (store_id=S001,month=2026-10), executed the tool exactly once with those values, and returned the supplied sales value (1,286,400).clean verifyand live thinking-enabled verification were not run.