fix(agui): add metadata field to AguiMessage for HITL confirm results - #2452
Open
Blue-Berrys wants to merge 2 commits into
Open
fix(agui): add metadata field to AguiMessage for HITL confirm results#2452Blue-Berrys wants to merge 2 commits into
Blue-Berrys wants to merge 2 commits into
Conversation
Allow AG-UI clients to pass agentscope_confirm_results via message metadata so permission confirmation can complete over the protocol. Closes agentscope-ai#1726.
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
oss-maintainer
approved these changes
Jul 28, 2026
oss-maintainer
left a comment
Collaborator
There was a problem hiding this comment.
Review — Approved ✅
This addresses the critical HITL confirmation gap in the AG-UI adapter (#2437, #1726).
Code analysis:
- Adding
metadataas an optionalMap<String, Object>field toAguiMessageis the right approach — it's the natural place for HITL confirm results without disrupting the existing message model. - Backward compatibility is well handled: existing 5-arg constructor delegates to the new 6-arg one with
nullmetadata. All static factory methods updated. - Immutable map wrapping (
Collections.unmodifiableMap(new LinkedHashMap<>(...))) is correct. @JsonInclude(JsonInclude.Include.NON_EMPTY)ensures metadata doesn't pollute serialized output when absent.equals()/hashCode()/toString()all properly updated.
Converter:
- Bidirectional metadata transfer in
toMsg()andtoAguiMessage()is clean and null-safe.
Tests:
- Roundtrip tests for metadata in both directions + empty metadata edge case. Good coverage.
This is the missing bridge for RequireUserConfirmEvent mentioned in #2437. Well done.
LGTM. Please sign the CLA.
Skip redundant async mirrors when the write target is already local disk, and drain pending mirrors on HarnessAgent.close() so CI no longer flakes on LocalFilesystemUserIsolationExampleTest.
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Blue-Berrys
force-pushed
the
fix/1726-agui-message-metadata
branch
from
July 28, 2026 08:09
1941a10 to
ee21eb7
Compare
This was referenced Jul 28, 2026
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.
Summary
metadatatoAguiMessage(JSON-compatible, backward compatible).AguiMessageConvertersoagentscope_confirm_resultscan reachMsg.metadata.Closes #1726
Description
AG-UI messages previously had no metadata channel, so frontends could not attach HITL
ConfirmResults underagentscope_confirm_results. This blocked permission confirmation over AG-UI.Checklist
mvn spotless:applyAguiMessageConverterTest, 26 tests)Testing
JAVA_HOME=/path/to/jdk21 mvn \ -pl agentscope-extensions/agentscope-extensions-protocol/agentscope-extensions-agui -am \ -Dspotless.check.skip=true \ -Dtest=AguiMessageConverterTest,AguiModelTest \ -Dsurefire.failIfNoSpecifiedTests=false \ test