Skip to content

feat(agui): serialize data and file media sources on outbound - #4297

Merged
jujn merged 5 commits into
agentscope-ai:mainfrom
xzxiaoshan:feat/agui-outbound-media-sources
Nov 21, 2026
Merged

jujn merged 5 commits into
agentscope-ai:mainfrom
xzxiaoshan:feat/agui-outbound-media-sources

Conversation

@xzxiaoshan

Copy link
Copy Markdown
Collaborator

AgentScope-Java Version

2.1.0-SNAPSHOT

Description

The AG-UI protocol defines three source types for media parts — url, data (inline Base64), and file (provider-issued handle) — and the inbound direction accepts all three. The outbound path from #4003, however, serialized URL sources only: media blocks carrying a Base64Source or FileIdSource were dropped silently, with no log or fallback. Media sent as inline data or a file handle therefore disappears from MESSAGES_SNAPSHOT history on reconnects, refreshes, and session switches.

This change maps all three AgentScope source types on the outbound path, mirroring the document handling #3979 established in toDocumentInputContent.

Changes

  • ImageBlock / AudioBlock / VideoBlock serialize as url / data / file sources through a shared toInputContentSource mapping; inline Base64 keeps its data and media type, and a file handle keeps its provider.
  • DataBlock keeps MIME-type routing for URL sources, routes inline data by its declared media type, and carries a provider file handle as a document part — the protocol's generic carrier for opaque data.
  • New serialization and round-trip tests replace testConvertBase64MediaBlocksAreSkippedOnOutbound, which asserted the old skip behavior.
  • EN/ZH docs: the Compatibility Notes still carried the pre-feat(agui): convert URL media blocks to AG-UI input contents #4003 wording ("document types are not supported yet"; blocks "are not serialized back") that feat(durable): add recoverable runtime and streamline public APIs #4154 accidentally restored; both pages now describe the actual multimodal behavior and the new outbound mapping.

@mintlify

mintlify Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Preview approval required

This pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit eaf12ce.

Approve preview

@jujn
jujn force-pushed the feat/agui-outbound-media-sources branch from f18bd69 to eaf12ce Compare November 21, 2026 07:02
@jujn
jujn merged commit 2fb5400 into agentscope-ai:main Nov 21, 2026
7 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