Skip to content

feat: add SendLiveMessage bidirectional streaming support - #28

Draft
Tehsmash wants to merge 20 commits into
mainfrom
feat/send-live-message
Draft

Tehsmash wants to merge 20 commits into
mainfrom
feat/send-live-message

Conversation

@Tehsmash

@Tehsmash Tehsmash commented Sep 3, 2026

Copy link
Copy Markdown
Member

Summary

  • Implements the SendLiveMessage bidi streaming RPC from the A2A v1.1 proposal (Tehsmash/a2a-python@feat/send-live-message)
  • Adds SlimRPC stub, server handler, and client transport support for the new stream-stream method
  • Points a2a-sdk dependency at the upstream branch until it is released; will be updated to a pinned version once merged upstream
  • Updates the echo agent client example with a --live flag demonstrating the new method

Changes

slima2a/types/v1/a2a_pb2_slimrpc.py

  • A2AServiceStub.SendLiveMessage — returns BidiStreamHandler via channel.call_stream_stream
  • A2AServiceServicer.SendLiveMessage — UNIMPLEMENTED base stub
  • _A2AServiceServicer_SendLiveMessage_Handler(StreamStreamHandler) — decodes StreamRequest bytes, passes to servicer async-generator, encodes StreamResponse to sink
  • add_A2AServiceServicer_to_server — registers via server.register_stream_stream

slima2a/handler.py

  • SRPCHandler.SendLiveMessage — bridges RequestStream to decoded async iterable of StreamRequest, calls request_handler.on_live_message_send, yields StreamResponse

slima2a/client_transport.py

  • SRPCTransport.send_live_message — opens bidi handle, concurrently sends serialized requests and yields decoded StreamResponse events

examples/echo_agent/client.py

  • --live flag and send_live_message() function demonstrating the new API

pyproject.toml / uv.lock

  • a2a-sdk pointed at Tehsmash/a2a-python@feat/send-live-message for StreamRequest and on_live_message_send

Notes

  • No changes to AgentExecutorDefaultRequestHandler (DefaultRequestHandlerV2) already implements on_live_message_send and routes through the existing execute() path
  • The a2a-sdk dependency pin should be updated to a stable release once the upstream PR is merged

Implements the SendLiveMessage bidi streaming RPC from the A2A v1.1
proposal (https://github.com/Tehsmash/a2a-python/tree/feat/send-live-message).

- Add SendLiveMessage to A2AServiceStub (client, via call_stream_stream),
  A2AServiceServicer (UNIMPLEMENTED stub), _A2AServiceServicer_SendLiveMessage_Handler
  (StreamStreamHandler), and register_stream_stream in add_A2AServiceServicer_to_server
- Add SRPCHandler.SendLiveMessage: bridges RequestStream to decoded async
  iterable of StreamRequest protos, delegates to request_handler.on_live_message_send
- Add SRPCTransport.send_live_message: opens BidiStreamHandler, concurrently
  sends serialized StreamRequests and yields decoded StreamResponse events
- Point a2a-sdk dependency to Tehsmash/a2a-python@feat/send-live-message
  (the branch adding StreamRequest and on_live_message_send)
- Add --live flag to echo_agent client example demonstrating the new method

Signed-off-by: Sam Betts <1769706+Tehsmash@users.noreply.github.com>
- Add A2AServiceGroupStub.SendLiveMessage using call_multicast_stream_stream,
  returning a MulticastBidiStreamHandler
- Add SRPCMulticastTransport.send_live_message: concurrently sends requests
  and yields (source, StreamResponse) tuples from all group members
- Add MulticastClient.send_live_message delegating to the transport

Signed-off-by: Sam Betts <1769706+Tehsmash@users.noreply.github.com>
Adds support for the broadcast extension to SendLiveMessage as described
in the slimrpc-broadcast-live spec. Every StreamResponse from any agent
in a group channel is delivered to all other participants via SLIM's
shared-responses transport primitive (slim-bindings PR #85).

- a2a_pb2_slimrpc.py: add A2AServiceSharedServicer base class,
  _A2AServiceServicer_SendLiveMessage_SharedHandler extending
  StreamStreamSharedHandler, and add_A2AServiceServicer_to_server_shared()
- handler.py: add SRPCSharedHandler with asyncio.Queue fan-in merge of
  client request stream and translated peer StreamResponse events;
  add _translate_peer_response() implementing spec Section 5 translation
  (task/status_update/artifact_update/message_update -> StreamRequest)
- client_transport.py: add slimrpc_group_shared_channel_factory() using
  Channel.new_group_shared_with_connection; add field to ClientConfig
- __init__.py: export slimrpc_group_shared_channel_factory
- examples/echo_agent/server.py: use Server.new_with_shared_responses_and_connection
  and register both SRPCHandler and SRPCSharedHandler so the server
  accepts both standard and broadcast sessions without any flags
- examples/echo_agent/client.py: add --broadcast flag that uses the
  shared channel factory and routes to MulticastClient.send_live_message

Signed-off-by: Sam Betts <1769706+Tehsmash@users.noreply.github.com>
Signed-off-by: Sam Betts <1769706+Tehsmash@users.noreply.github.com>
Signed-off-by: Sam Betts <1769706+Tehsmash@users.noreply.github.com>
Signed-off-by: Sam Betts <1769706+Tehsmash@users.noreply.github.com>
Signed-off-by: Sam Betts <1769706+Tehsmash@users.noreply.github.com>
Signed-off-by: Sam Betts <1769706+Tehsmash@users.noreply.github.com>
… RequestStream

Signed-off-by: Sam Betts <1769706+Tehsmash@users.noreply.github.com>
…ueueShutDown

Signed-off-by: Sam Betts <1769706+Tehsmash@users.noreply.github.com>
Signed-off-by: Sam Betts <1769706+Tehsmash@users.noreply.github.com>
…es early

Signed-off-by: Sam Betts <1769706+Tehsmash@users.noreply.github.com>
… in client

Signed-off-by: Sam Betts <1769706+Tehsmash@users.noreply.github.com>
Signed-off-by: Sam Betts <1769706+Tehsmash@users.noreply.github.com>
Signed-off-by: Sam Betts <1769706+Tehsmash@users.noreply.github.com>
Signed-off-by: Sam Betts <1769706+Tehsmash@users.noreply.github.com>
…messages)

Signed-off-by: Sam Betts <1769706+Tehsmash@users.noreply.github.com>
Per spec §6 slim-src must be set on all messages in broadcast mode.
Client sets slim-src in RPC call metadata; server reads it from
context.metadata() and stamps each decoded StreamRequest from the
client stream. Executor now captures client identity on first turn
and skips messages from other senders by comparing slim-src.

Signed-off-by: Sam Betts <1769706+Tehsmash@users.noreply.github.com>
Read slim-src identity directly from Channel.local_name accessor instead
of threading local_name through ClientConfig and transport constructors.

Add interactive stdin mode to the echo agent client: omitting --text in
--live or --broadcast mode reads lines from stdin, sending each as a
StreamRequest and printing responses inline.

Signed-off-by: Sam Betts <1769706+Tehsmash@users.noreply.github.com>
Signed-off-by: Sam Betts <1769706+Tehsmash@users.noreply.github.com>
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.

1 participant