Skip to content

Negotiate transport instead of hardcoding JSON-RPC #105

Description

@alDuncanson

The A2A specification defines three transport bindings and the SDK ships all three, but Handler hardcodes JSON-RPC. A REST-only or gRPC-only agent cannot be connected at all, even though the dependency to do it is already installed.

Where it stands

service.py:

client_config = ClientConfig(
    supported_protocol_bindings=[TransportProtocol.JSONRPC.value],
    ...
)

The SDK offers JSONRPC, HTTP+JSON, and GRPC (a2a.utils.constants.TransportProtocol), with JsonRpcTransport, RestTransport, and GrpcTransport implementations.

The work

  • Offer all bindings Handler can actually support and let the agent card decide, which is what ClientConfig.use_client_preference is for
  • gRPC needs a channel factory (grpc_channel_factory) and may need an extra dependency — check whether it pulls weight worth adding, and consider making it an optional extra
  • Surface the negotiated transport in the TUI connection bar; the card panel already shows protocolBinding

Acceptance

  • A REST-only agent connects
  • The chosen binding is visible to the user
  • If gRPC needs an optional extra, connecting without it fails with a clear install hint

Note: this is a small change with meaningful reach — most of the work is deciding the gRPC dependency question.

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.

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