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
[Bug]: tool_call_args is empty in ag protocol due to incomplete handling of streamed tool call arguments #498
AgentScope-Java is an open-source project. To involve a broader community, we recommend asking your questions in English.
Describe the bug
When using the ag protocol, the tool_call_args field returned by the server is always empty. This appears to be due to the fact that arguments (args) are streamed via multiple events, but the current implementation only captures args on the first tool-type event and ignores subsequent chunks. Additionally, the code does not handle streaming for events of type toolresult, although it's unclear whether toolresult is intended to support streaming at all.
To Reproduce
Steps to reproduce the behavior:
Use the AgentScope-Java SDK with the ag protocol.
Invoke an agent that triggers a tool call with streaming enabled (i.e., stream: true).
Observe the received events containing tool type — only the first event’s args are captured; subsequent streaming chunks containing additional args data are ignored.
If a toolresult event is streamed (if applicable), its payload is also not properly accumulated.
Expected behavior
The tool_call_args should be fully reconstructed by aggregating all streamed chunks for tool-type events. If toolresult supports streaming, its content should also be properly accumulated across events.
Error messages
No explicit exception is thrown, but the resulting tool_call_args is incomplete or empty despite the server sending incremental argument data via multiple events.
Environment (please complete the following information):
AgentScope-Java Version: [e.g., 1.0.6 — please check your pom.xml or run mvn dependency:tree | grep agentscope-parent:pom]
Java Version: [e.g., 17]
OS: [e.g., macOS, Windows, Linux]
Additional context
This issue likely stems from the event handling logic in the streaming response parser, which assumes tool arguments are delivered in a single event rather than incrementally. A robust implementation should buffer and concatenate args (and potentially toolresult content) across multiple streaming events until the tool interaction is complete.
changed the title [-][Bug]: ag-ui协议模式下输出的tool_call_args永远是空的,另外当event为toolresult类型时,也没有处理流式的场景(我不太确定是否有流式的场景)[/-][+][Bug]: tool_call_args is empty in ag protocol due to incomplete handling of streamed tool call arguments[/+]on Jan 9, 2026
Using agui to pass in frontend tools, not currently supported?
After adding the registration logic and fixing the tool call arguments event problem, it works fine, but the agent doesn't handle anything when it asks again.
Activity
[-][Bug]: ag-ui协议模式下输出的tool_call_args永远是空的,另外当event为toolresult类型时,也没有处理流式的场景(我不太确定是否有流式的场景)[/-][+][Bug]: tool_call_args is empty in ag protocol due to incomplete handling of streamed tool call arguments[/+]yangxb2010000 commentedon Jan 9, 2026
In addition, the result of toolcall should be placed in the toolcallResult event, which is currently placed in the toolcallend event. reference resources: https://docs.ag-ui.com/concepts/events#toolcallchunk
fix: The tool_call_args returned by ag ui is empty, and a toolcallres…
harmonyzhang commentedon Jan 12, 2026
Using agui to pass in frontend tools, not currently supported?
After adding the registration logic and fixing the tool call arguments event problem, it works fine, but the agent doesn't handle anything when it asks again.