Skip to content

fix(agui): Suppress ReActAgent handshake events in AG-UI converters - #2639

Merged
zouyx merged 3 commits into
mainfrom
fix/agui-suppress-react-handshake-events
Aug 12, 2026
Merged

fix(agui): Suppress ReActAgent handshake events in AG-UI converters#2639
zouyx merged 3 commits into
mainfrom
fix/agui-suppress-react-handshake-events

Conversation

@jujn

@jujn jujn commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR suppresses ReActAgent handshake events from the default AG-UI event stream so they do not fall through to RAW events.

Changes include:

  • Register UserConfirmResultEvent in PermissionConfirmEventConverter as a no-op.
  • Add ExternalExecutionEventConverter to no-op RequireExternalExecutionEvent and ExternalExecutionResultEvent.
  • Register the new external execution converter in the AG-UI converter registry.

Checklist

Please check the following items before code is ready to be reviewed.

  • Code has been formatted with mvn spotless:apply
  • All tests are passing (mvn test)
  • Javadoc comments are complete and follow project conventions
  • Related documentation has been updated (e.g. links, examples, etc.)
  • Code is ready for review

Copilot AI lite review requested due to automatic review settings August 9, 2026 15:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 updates the AG-UI adapter’s default event-converter registry to explicitly suppress ReActAgent “handshake” events (permission confirm results and external-execution request/result events) so they don’t fall through to RAW events in the AG-UI stream.

Changes:

  • Register UserConfirmResultEvent as a no-op in PermissionConfirmEventConverter to prevent default RAW emission.
  • Introduce ExternalExecutionEventConverter to no-op RequireExternalExecutionEvent and ExternalExecutionResultEvent.
  • Extend test coverage to assert suppression behavior and confirm custom converters can still override the suppressed defaults.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
agentscope-extensions/agentscope-extensions-protocol/agentscope-extensions-agui/src/test/java/io/agentscope/core/agui/adapter/AguiAgentAdapterV2Test.java Adds tests verifying handshake events are suppressed and that custom converters can override suppressed defaults.
agentscope-extensions/agentscope-extensions-protocol/agentscope-extensions-agui/src/main/java/io/agentscope/core/agui/adapter/strategy/PermissionConfirmEventConverter.java Registers UserConfirmResultEvent and no-ops it to avoid RAW fallback.
agentscope-extensions/agentscope-extensions-protocol/agentscope-extensions-agui/src/main/java/io/agentscope/core/agui/adapter/strategy/ExternalExecutionEventConverter.java Adds a dedicated no-op converter for external execution handshake events.
agentscope-extensions/agentscope-extensions-protocol/agentscope-extensions-agui/src/main/java/io/agentscope/core/agui/adapter/strategy/AgentEventConverterRegistry.java Registers the new external execution converter in the built-in converter set.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@codecov

codecov Bot commented Aug 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@AgentScopeJavaBot AgentScopeJavaBot added bug Something isn't working area/ext/integration External protocols & middleware integrations labels Aug 11, 2026
@jujn
jujn requested a review from oss-maintainer August 11, 2026 12:14

@AgentScopeJavaBot AgentScopeJavaBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Review

This PR suppresses ReActAgent external-execution handshake events (RequireExternalExecutionEvent, ExternalExecutionResultEvent) and UserConfirmResultEvent from the default AG-UI event stream. Without this change, these events fall through to the RawAgentEventConverter and leak as RAW events — duplicating information already surfaced through the native RUN_FINISHED.outcome interrupt contract. The fix introduces a new no-op ExternalExecutionEventConverter and extends PermissionConfirmEventConverter to also absorb UserConfirmResultEvent. The approach is consistent with the existing converter architecture, well-tested, and correctly handles the custom-converter-override path.

* {@code ToolUseBlock}, and tool-input validation reads {@code content} directly with no fallback to
* {@code input}; a null content would fail the resume with {@code argument "content" is null}.
*
* <p>{@link UserConfirmResultEvent} is intentionally registered here as a no-op..

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Double period typo in Javadoc: "is intentionally registered here as a no-op.." — remove the trailing extra ..

@AgentScopeJavaBot AgentScopeJavaBot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI Review

This PR suppresses ReActAgent external-execution handshake events (RequireExternalExecutionEvent, ExternalExecutionResultEvent) and UserConfirmResultEvent from the default AG-UI event stream. Without this change, these events fall through to the RawAgentEventConverter and leak as RAW events — duplicating information already surfaced through the native RUN_FINISHED.outcome interrupt contract. The fix introduces a new no-op ExternalExecutionEventConverter and extends PermissionConfirmEventConverter to also absorb UserConfirmResultEvent. The approach is consistent with the existing converter architecture, well-tested, and correctly handles the custom-converter-override path.

* {@code ToolUseBlock}, and tool-input validation reads {@code content} directly with no fallback to
* {@code input}; a null content would fail the resume with {@code argument "content" is null}.
*
* <p>{@link UserConfirmResultEvent} is intentionally registered here as a no-op..

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Double period typo in Javadoc: "is intentionally registered here as a no-op.." — remove the trailing extra ..

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@zouyx
zouyx merged commit a425660 into main Aug 12, 2026
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/ext/integration External protocols & middleware integrations bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants