-
Notifications
You must be signed in to change notification settings - Fork 247
fix: add tooluseblock start #591
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: add tooluseblock start #591
Conversation
|
|
|
releate #588 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes an issue with the qwen3-max model where ToolUseBlock events are returned all at once at the end of streaming instead of incrementally, causing ToolCallStart events to be missing. The fix implements a backfill mechanism that caches ToolUseBlocks when they arrive during REASONING events, then emits the missing ToolCallStart and ToolCallArgs events when ToolResultBlock is processed.
Changes:
- Added caching mechanism for ToolUseBlock instances to support delayed ToolCallStart event emission
- Implemented backfill logic that checks for missing ToolCallStart events when processing ToolResult events
- Added HashMap to store ToolUseBlock instances by tool call ID for later retrieval
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...entscope-extensions-agui/src/main/java/io/agentscope/core/agui/adapter/AguiAgentAdapter.java
Outdated
Show resolved
Hide resolved
...entscope-extensions-agui/src/main/java/io/agentscope/core/agui/adapter/AguiAgentAdapter.java
Outdated
Show resolved
Hide resolved
...entscope-extensions-agui/src/main/java/io/agentscope/core/agui/adapter/AguiAgentAdapter.java
Outdated
Show resolved
Hide resolved
...entscope-extensions-agui/src/main/java/io/agentscope/core/agui/adapter/AguiAgentAdapter.java
Show resolved
Hide resolved
...entscope-extensions-agui/src/main/java/io/agentscope/core/agui/adapter/AguiAgentAdapter.java
Show resolved
Hide resolved
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
AlbumenJ
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.



AgentScope-Java Version
[The version of AgentScope-Java you are working on, e.g. 1.0.7, check your pom.xml dependency version or run
mvn dependency:tree | grep agentscope-parent:pom(only mac/linux)]Description
[Please describe the background, purpose, changes made, and how to test this PR]
qwen3max:
Behavior: ToolUseBlock is not returned during the streaming phase; it is returned all at once at the last moment.
Streaming Phase: No ToolCallStart. A replacement is sent when END is detected.
点击查看测试代码
Checklist
Please check the following items before code is ready to be reviewed.
mvn spotless:applymvn test)