You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c52d1fc
Browse filesBrowse the repository at this point in the historyBrowse files
## Problem
Parallel client tool calls are rewritten into alternating assistant/user
exchanges, and individual tool results are emitted as separate user
messages. This changes the original tool batch structure and does not
follow Anthropic's documented parallel result format. DeepSeek's
official endpoint rejects separate result messages with HTTP 400 in the
direct test below; the gateway-specific 502 reported in #4018 has not
been reproduced.
## Changes
- Preserve all tool uses in their original assistant message.
- Group consecutive client tool results into one user message, placing
results before accompanying text or media.
- Keep server tool blocks inline and stop result grouping at
conversation boundaries.
- Update formatter/model comments and regression tests for
separate/combined results, mixed text, multiple turns, and assistant
messages carrying client tool results.
- Use an explicit batch end index without rewinding the loop cursor;
name accompanying content `trailingContent`.
Fixes#4018.
Related: #3740 includes broader native thinking/history replay changes;
this PR focuses on parallel tool batch formatting.
Copy file name to clipboardExpand all lines: agentscope-extensions/agentscope-extensions-model/agentscope-extensions-model-anthropic/src/main/java/io/agentscope/extensions/model/anthropic/AnthropicChatModel.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -59,7 +59,7 @@
59
59
*
60
60
* <ul>
61
61
* <li>System messages are handled via the system parameter, not as messages
62
-
* <li>Tool results must be in separate user messages
62
+
* <li>All results for a tool batch must be in one following user message
63
63
* <li>Supports Claude models (claude-3-*, claude-sonnet-*, etc.)
Copy file name to clipboardExpand all lines: agentscope-extensions/agentscope-extensions-model/agentscope-extensions-model-anthropic/src/main/java/io/agentscope/extensions/model/anthropic/formatter/AnthropicChatFormatter.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -30,7 +30,7 @@
30
30
*
31
31
* <ul>
32
32
* <li>Only the first message can be a system message (handled via system parameter)
33
-
* <li>Tool results must be in separate user messages
33
+
* <li>All results for a tool batch must be in one following user message
Copy file name to clipboardExpand all lines: agentscope-extensions/agentscope-extensions-model/agentscope-extensions-model-anthropic/src/main/java/io/agentscope/extensions/model/anthropic/formatter/AnthropicMessageConverter.java
0 commit comments