Repository navigation
fix(agui): dedupe resume tool results already present in messages - #2955
Merged
jujn merged 2 commits intoSep 5, 2026
Merged
Conversation
CopilotKit useInterrupt.resolve() sends both a role=tool message and resume[] for tool_call interrupts. Skip converting ordinary resumes that would duplicate an existing ToolResultBlock id so ReActAgent does not throw Duplicate tool result ID. Permission-confirm resumes still emit ConfirmResult.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
oss-maintainer
approved these changes
Sep 3, 2026
oss-maintainer
left a comment
Collaborator
There was a problem hiding this comment.
LGTM. This PR records ToolResultBlock IDs produced from incoming AG-UI messages and skips ordinary resume results when the ID already exists, while retaining permission-confirm results. I verified the converter call path, the ReActAgent duplicate-result validation, and null-list handling; the focused new tests and the full 48-test AguiMessageConverterTest suite pass, so the change is localized, correct, and adequately covered.
Automated review by github-manager-bot
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.
AgentScope-Java Version
2.0.3-SNAPSHOT(main)Description
Background
CopilotKit v2
useInterrupt.resolve()forreason: "tool_call"interrupts attaches:messages:role:"tool"result (for UI / history)resume[]: protocol resume payloadAgentScope schema-only HITL (
registerSchema→TOOL_SUSPENDED→ interrupt) usesreason: "tool_call".AguiMessageConverter.toMsgListpreviously converted both into the sameToolResultBlockid →ReActAgentDuplicate tool result ID.Related CopilotKit issue #6201 does not remove dual-send for
tool_callinterrupts.Changes
AguiMessageConverter.toMsgList: skip ordinary tool resumes whosetoolCallIdalready has aToolResultBlockfrommessages(messages win; no payload comparison).agentscope.interruptKind=permission_confirm) still always append USERConfirmResult.How to test
mvn -pl agentscope-extensions/agentscope-extensions-protocol/agentscope-extensions-agui \ -Dtest=AguiMessageConverterTest#testCopilotKitDualPathSkipsDuplicateToolResultFromResume+testPermissionConfirmResumeKeptWhenToolMessageAlreadyPresent \ testOptional E2E:
agentscope-copilotkitagentdefault, schema-onlyrequestHumanApproval, resume with tool message +resume[]— should continue withoutDuplicate tool result ID.Checklist
mvn spotless:applyFixes #2954