Skip to content

Fix: propagate MessageSendParams.metadata to Worker via TaskSendParams#42

Open
nMaroulis wants to merge 1 commit intopydantic:mainfrom
nMaroulis:main
Open

Fix: propagate MessageSendParams.metadata to Worker via TaskSendParams#42
nMaroulis wants to merge 1 commit intopydantic:mainfrom
nMaroulis:main

Conversation

@nMaroulis
Copy link

Context
According to the A2A specification, MessageSendParams includes an optional metadata field intended for extension-specific data:
https://a2a-protocol.org/latest/specification/#711-messagesendparams-object

The Worker.run_task() method already accepts a TaskSendParams object that also defines a metadata field for this purpose.
However, when a message is forwarded to the broker via TaskManager.send_message(), the metadata field from MessageSendParams is currently dropped and not included in the constructed TaskSendParams.

Issue
This prevents Workers from accessing extension metadata that was explicitly provided at the message level, making it impossible to implement certain extensions or advanced workflows that rely on this information.

Change
This PR fixes the issue by forwarding request['params']['metadata'] into the broker_params object when initializing TaskSendParams in TaskManager.send_message().

Specifically, the following field is now included:

'metadata': request['params'].get('metadata')

Impact

  • Aligns the implementation with the A2A specification
  • Restores access to extension metadata inside Workers
  • Backward-compatible (no behavior change when metadata is absent)
  • Minimal and low-risk change

Related issue
Fixes: #41

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.

MessageSendParams.metadata not passed through to Worker

1 participant