Skip to content

refactor(agui): delimit the outbound message id and its suffix - #4554

Merged
jujn merged 1 commit into
agentscope-ai:mainfrom
xzxiaoshan:fix/agui-outbound-message-id-delimiter
Dec 2, 2026
Merged

jujn merged 1 commit into
agentscope-ai:mainfrom
xzxiaoshan:fix/agui-outbound-message-id-delimiter

Conversation

@xzxiaoshan

Copy link
Copy Markdown
Collaborator

Summary

This is an optimization of the outbound message ID format, not a bug fix. AguiMessageConverter.toAguiMessages builds the ID of an outbound AG-UI message as agui::<sourceId>-<UUID>. That format is usable: a reader who knows that the suffix is a UUID can strip it by its length. It is simply less reliable to depend on in the long run. The separator is a hyphen, which the UUID itself and many source ids also contain, so the source id can only be recovered by counting the fixed length of the UUID rather than by finding a boundary the format guarantees.

This changes the tail to ::<UUID without hyphens>. The suffix no longer contains the separator, so the source id is whatever precedes the last ::. Reading the source id back then no longer depends on the length of the suffix, and source ids that contain hyphens or colons need no special handling. The prefix and the rule that reuses an id which already carries it are unchanged. The id format introduced in #3239 changes for callers of these conversion methods; the adapter's run path streams events and does not call them.

Changes

  • generatedMessageId appends :: and a hyphen-free UUID instead of - and a UUID.
  • The Javadoc of toAguiMessages and toAguiMessageList states the format and how to read the source id back.
  • The converter tests assert the full shape of the id and cover source ids that contain colons.

@jujn
jujn merged commit 1cf8060 into agentscope-ai:main Dec 2, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants