Skip to content

Send non-text parts (files and structured data) #99

Description

@alDuncanson

Handler can only build text parts, so a user can never send a file or structured data. This is the largest remaining content gap and it is outbound-only.

Where it stands

An A2A Part carries one of four payloads plus filename and media_type:

Payload Send Receive
text yes yes
raw (inline bytes) no summarized
url (file by reference) no summarized
data (structured) no summarized

Receiving is in better shape than it looks: part_kind, part_file, and part_data in service.py already back previews in the Tasks and Artifacts panels and in the CLI. Extracting a received part in full is tracked separately.

The work

A2AService._build_user_message hardcodes parts=[Part(text=message_text)]. That is the root of it.

  • CLI: --file PATH (repeatable) and --data JSON on message send and message stream. A file should become a raw part with filename and a sniffed media_type, or a url part when given a URL.
  • TUI: a way to attach a file to the composer.
  • Both should refuse a file that exceeds a sane inline limit and point at the url form instead.

Acceptance

  • handler message send --url URL --text "review this" --file ./report.pdf sends a two-part message
  • handler message send --url URL --data '{"k":"v"}' sends a data part
  • The TUI can attach a file
  • Round-trip tested against a real agent, not only mocks

Part of the A2A v1.0 parity work.


Context: Handler was audited against the A2A v1.0 specification after the v0.2.0 release. Method coverage at the time: service 7/11, CLI 7/11, TUI 4/11 (after #98), MCP 6/11. The four methods missing everywhere are ListTasks, ListTaskPushNotificationConfigs, DeleteTaskPushNotificationConfig, and GetExtendedAgentCard. A deterministic streaming test agent lives outside the repo at ~/code/handler-streaming-agent — it supports ask (input-required), slow (cancellable), and fail, and its card sets capabilities.streaming = true, which ADK does not do by default.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    a2a-parityClosing gaps against the A2A v1.0 specificationenhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions