Skip to content

A2A: propagate request and message metadata through the bridge#282

Merged
rockfordlhotka merged 2 commits intomainfrom
issue-281/a2a-propagate-metadata
Apr 21, 2026
Merged

A2A: propagate request and message metadata through the bridge#282
rockfordlhotka merged 2 commits intomainfrom
issue-281/a2a-propagate-metadata

Conversation

@rockfordlhotka
Copy link
Copy Markdown
Member

Summary

  • Add optional Metadata: IReadOnlyDictionary<string, string>? to AgentMessage and AgentTaskRequest.
  • In RockBotBridgeHandler, populate AgentTaskRequest.Metadata from RequestContext.Metadata (minus the "skill" key already consumed for routing) and AgentMessage.Metadata from the incoming Message.Metadata. JsonElement values are stringified; non-string kinds are preserved via their raw JSON text.
  • Map all inbound Parts (not just the first text) into AgentMessagePart, propagating Kind = "data" parts with their JSON body and MediaType.
  • On the reply path, map the handler-returned AgentMessage.Metadata back onto outbound Message.Metadata, and emit data parts via Part.FromData — text parts continue to pass through as before.
  • Task history now preserves the client's original Message verbatim instead of a text-only rebuild, so captured history reflects what was actually sent.

Test plan

  • Existing tests pass (all projects)
  • New JSON round-trip tests for AgentMessage.Metadata and AgentTaskRequest.Metadata in RockBot.A2A.Tests
  • New bridge-helper tests in RockBot.A2A.Gateway.Tests covering: "skill" key stripped from request metadata, text/data part mapping in both directions, stringification of JsonElement values, and JsonElement round-trip for replies

Closes #281

🤖 Generated with Claude Code

rockfordlhotka and others added 2 commits April 21, 2026 17:23
Add optional Metadata dictionaries to AgentMessage and AgentTaskRequest,
and map them (plus non-text parts) across the HTTP → RabbitMQ bridge so
capability handlers can read structured inputs a caller attached to an
A2A v1 request. The "skill" key stays consumed for routing; everything
else on SendMessageRequest.Metadata lands on AgentTaskRequest.Metadata,
and Message.Metadata round-trips through AgentMessage.Metadata. Data
parts are mapped alongside text parts in both directions.

Closes #281

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@rockfordlhotka rockfordlhotka merged commit 7c4e5b3 into main Apr 21, 2026
2 of 3 checks passed
@rockfordlhotka rockfordlhotka deleted the issue-281/a2a-propagate-metadata branch April 21, 2026 22:51
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.

A2A: propagate request and message metadata through the HTTP→bus bridge

1 participant