fix(extensions-agui): convert SUMMARY events to AG-UI messages (#1029)#1168
Open
lynx009 wants to merge 3 commits intoagentscope-ai:mainfrom
Open
fix(extensions-agui): convert SUMMARY events to AG-UI messages (#1029)#1168lynx009 wants to merge 3 commits intoagentscope-ai:mainfrom
lynx009 wants to merge 3 commits intoagentscope-ai:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes extensions-agui event conversion so that AgentScope EventType.SUMMARY events (emitted as a fallback when a ReAct agent hits maxIters) are converted into AG-UI text-message events, ensuring the client receives the summary content instead of only RUN_FINISHED.
Changes:
- Extend
AguiAgentAdapterconversion logic to treatEventType.SUMMARYlikeEventType.REASONINGfor text/reasoning block mapping. - Update adapter Javadoc to reflect SUMMARY event mapping.
- Add regression tests covering both single-chunk and multi-chunk streaming summary scenarios.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
agentscope-extensions/agentscope-extensions-agui/src/main/java/io/agentscope/core/agui/adapter/AguiAgentAdapter.java |
Adds EventType.SUMMARY handling to the existing REASONING conversion path and updates the documented event mapping. |
agentscope-extensions/agentscope-extensions-agui/src/test/java/io/agentscope/core/agui/adapter/AguiAgentAdapterTest.java |
Adds tests verifying SUMMARY events are converted into AG-UI TEXT_MESSAGE_* events for both non-streaming-like and streaming-like summary emissions. |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Author
f543ac6 to
384c4de
Compare
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.



Description
Fixes #1029.
When a ReAct agent reaches
maxIters, AgentScope emits aSUMMARYevent as a fallback response.Before this change,
extensions-aguionly convertedREASONINGevents into AG-UI text events, so the client only receivedRUN_FINISHEDand could not see the summary content.This PR updates the AG-UI adapter to also convert
EventType.SUMMARYusing the existing text-message mapping path.As a result, when the agent stops because it exceeds
maxIters, the frontend can still receive the final summary content through AG-UI events.Changes included:
EventType.SUMMARYin the AG-UI adapterHow to verify:
maxIters=1TOOL_CALL_RESULTwithRUN_FINISHEDTEXT_MESSAGE_START / TEXT_MESSAGE_CONTENT / TEXT_MESSAGE_ENDChecklist