Skip to content

feat(agui): Upgrade AG_UI module event mechanism - #2306

Open
jujn wants to merge 13 commits into
mainfrom
agui/update-event
Open

feat(agui): Upgrade AG_UI module event mechanism#2306
jujn wants to merge 13 commits into
mainfrom
agui/update-event

Conversation

@jujn

@jujn jujn commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator

Description

Close #2202

1.0 stream() → 2.0 streamEvents()

This PR upgrades the AG-UI v2 integration to better align with the official AG-UI protocol and make the adapter easier to extend.

Key Changes

  • Introduces a converter registry for AgentEvent -> AguiEvent mapping, allowing users to register custom AgentEventConverters that can override built-in mappings.
  • Adds AguiEventEnricher support for cross-cutting event decoration such as timestamp, rawEvent, tracing metadata, or custom event rewriting.
  • Adds optional AG-UI base event properties support across all AguiEvent types via timestamp and rawEvent.
  • Simplifies v2 lifecycle handling by converting AgentStartEvent / AgentEndEvent into RUN_STARTED / RUN_FINISHED through the normal converter path.
  • Adds optional token usage emission as CUSTOM token_usage events with delta and cumulative usage.
  • Adds official RunAgentInput.resume[] support for HITL interrupts and bridges tool-call resumes back into AgentScope tool-result recovery.
  • Enforces AG-UI interrupt contract rules for open interrupts: pending interrupts block new input, and resume requests must cover all open interrupts. Extends Spring Boot starter support for custom converters, custom enrichers, token usage config, request-scoped RuntimeContext resolution, and custom adapter factories.
  • Adds a full AG-UI example project demonstrating streaming events, custom converters/enrichers, token usage, frontend tools, and HITL approval flow. Path: https://github.com/agentscope-ai/agentscope-java/tree/main/agentscope-examples/agui
  • Updates AG-UI documentation in v1/v2 Chinese and English docs to reflect the current module behavior.

Copilot AI review requested due to automatic review settings July 19, 2026 15:48

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@oss-maintainer oss-maintainer 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.

Summary

This PR contains 3314 lines of changes. Review in progress.


Automated review by github-manager-bot

@AgentScopeJavaBot AgentScopeJavaBot added enhancement New feature or request area/ext/integration External protocols & middleware integrations area/examples agentscope-examples labels Jul 20, 2026
@jujn
jujn force-pushed the agui/update-event branch from 849a381 to 70d7019 Compare July 24, 2026 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/examples agentscope-examples area/ext/integration External protocols & middleware integrations enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Upgrade AG_UI module event mechanism

4 participants