Skip to content

feat(agui): map the AG-UI message name field bidirectionally - #4343

Merged
xzxiaoshan merged 1 commit into
agentscope-ai:mainfrom
xzxiaoshan:feat/agui-message-name
Nov 23, 2026
Merged

xzxiaoshan merged 1 commit into
agentscope-ai:mainfrom
xzxiaoshan:feat/agui-message-name

Conversation

@xzxiaoshan

@xzxiaoshan xzxiaoshan commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

The AG-UI protocol defines an optional name field (sender name) on messages, but AguiMessage had no binding for it: inbound names were dropped by Jackson, and outbound Msg.name never reached the wire. This broke speaker attribution in multi-agent chats over the AG-UI channel.

  • AguiMessage: add the nullable name field to the @JsonCreator constructor, keep the existing 5/6-param constructors as delegating overloads, and add name-carrying factory overloads. The key is omitted from JSON when null.
  • AguiMessageConverter: map name both ways — inbound wire name populates Msg.name; every outbound AG-UI message (standard, reasoning split, per-tool-result split) carries Msg.name.
  • AguiMessageConverterTest: 8 new cases covering inbound/outbound mapping, JSON round-trip, null-key omission, and the split paths.

The field is optional on the wire: messages without a name serialize exactly as before, and old peers are unaffected.

`AguiMessage.content` 现在使用类型化消息内容表示。仅处理纯文本时,请使用 `getTextContent()`。

AG-UI 消息的 `name` 字段(发送者名)为双向映射:入站 wire `name` 会写入 `Msg.name`,出站 `Msg.name` 会输出到每条生成的 AG-UI 消息上(包括 reasoning 拆分与按工具结果拆分的消息)。字段缺省时出站 JSON 不输出该键。AG-UI 协议的 SSE 事件流本身不携带发送者名。

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.

感觉是不是没必要加这段文档描述了

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

那就剪掉它(已剪除,EN/ZH 同步移除:1b8986d)。

The AG-UI protocol's optional BaseMessage.name carries the sender name,
but AguiMessage had no binding for it: inbound names were dropped by
Jackson and outbound Msg.name never reached the wire, breaking speaker
attribution in multi-agent chats.

Add the nullable name field to AguiMessage (JsonCreator constructor plus
overload-preserving 5/6-param constructors, name-carrying factory
overloads, NON_NULL serialization) and map it both ways in
AguiMessageConverter: toMsg populates Msg.name, and every outbound
message (standard, reasoning split, per-tool-result split) carries
Msg.name. Existing callers and wire JSON are unaffected when the field
is absent.
@xzxiaoshan
xzxiaoshan force-pushed the feat/agui-message-name branch from 821e496 to 1b8986d Compare November 23, 2026 07:50
xzxiaoshan added a commit that referenced this pull request Nov 23, 2026
…et (#4346)

`JevEvidenceProcessorTest.filterFailureIsWithheldButRankFailureFollowsScoredEvidence`
failed on a loaded ubuntu runner (seen on PR #4343) with `expected:
<[scored, unranked]> but was: <[]>`: the class's 2s supervision budget
expired before any assessment completed, so the timeout fallback
reported every passage as UNSCREENED and delivered nothing. The mocks
reply instantly, so the budget is never the property under test.

Raise the class budget from 2s to 6s and advance the two virtual-time
TIMEOUT assertions past it (7s), matching the supervision-test fix in
#3672. Virtual-clock awaits cost no real time and instant-mock tests are
unaffected, so total test time is unchanged.
@xzxiaoshan
xzxiaoshan merged commit 9493f6a into agentscope-ai:main Nov 23, 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