Skip to content

feat(slimrpc): add Collaborate — many-to-many messaging on SLIM group channels - #111

Merged
muscariello merged 2 commits into
mainfrom
feat/slimrpc-collaborate
Jul 22, 2026
Merged

feat(slimrpc): add Collaborate — many-to-many messaging on SLIM group channels#111
muscariello merged 2 commits into
mainfrom
feat/slimrpc-collaborate

Conversation

@muscariello

Copy link
Copy Markdown
Member

Summary

Implements the demo-sufficient subset of the SLIMRPC collaborative channel extension (currently a draft spec, open for review):

rpc Collaborate(stream Message) returns (stream Message);

Unlike the existing multicast SendMessage/SendStreamingMessage (one client → many independent agent responses), Collaborate is genuinely many-to-many: any group-channel member may originate messages, and every message is broadcast to every other member. Reuses A2A's own Message type in both directions — no new proto types.

Changes

  • SlimRpcTransport::new_group/new_group_with_connection — build a transport over a SLIM group channel (slim_rpc::Channel::new_group), as opposed to the existing point-to-point new/new_with_connection.
  • SlimRpcTransport::collaborate(outbound, timeout) — drives Channel::multicast_stream_stream with A2A Message protos, and stamps every inbound Message with metadata["slim-src"] = the sender's SLIM name (from MulticastItem.context.source), per the spec's message-attribution requirement. Additive — not part of the point-to-point Transport trait, whose methods assume exactly one response per call.
  • register_collaborate — registers a listen-only Collaborate participant on a slim_rpc::Server: invokes a callback for every inbound Message, sends nothing of its own (empty reply stream), matching the spec's non-participation mode. Independent of RequestHandler, since Collaborate is a broadcast channel rather than request/response.

Not yet implemented (spec is still draft): Agent Card extension declaration, formal EOS/non-participation signaling beyond the empty reply stream, and server-side per-message sender attribution (Context/DecodedStream don't expose it with the current API — attribution is only available client-side via MulticastItem, which is what collaborate() uses).

Bumps a2a-slimrpc to 0.2.3; adds serde_json; promotes tokio to a real dependency (the SLIM stack already requires a tokio runtime transitively).

Test

slimrpc_collaborate_broadcasts_to_every_other_member: 3 members each independently broadcast one intro Message to the other two via collaborate(), and every other member's register_collaborate listener receives it — proving many-to-many delivery end to end. All existing tests + clippy + fmt pass.

… channels

Implements the demo-sufficient subset of the SLIMRPC collaborative channel
extension (a2aproject/experimental-cpb-slimrpc#5):

  rpc Collaborate(stream Message) returns (stream Message);

Unlike the existing multicast SendMessage/SendStreamingMessage (one client to
many independent agent responses), Collaborate is genuinely many-to-many: any
group-channel member may originate messages, and every message is broadcast to
every other member, reusing A2A's own Message type in both directions.

- SlimRpcTransport::new_group/new_group_with_connection build a transport over a
  SLIM group channel (slim_rpc::Channel::new_group), instead of the
  point-to-point new/new_with_connection.
- SlimRpcTransport::collaborate(outbound, timeout) drives
  Channel::multicast_stream_stream with A2A Message protos, and stamps every
  inbound Message with metadata["slim-src"] = the sender's SLIM name (from
  MulticastItem.context.source), per the spec's message-attribution
  requirement. Additive, not part of the point-to-point Transport trait, whose
  methods assume exactly one response per call.
- register_collaborate registers a listen-only Collaborate participant on a
  slim_rpc::Server: it invokes a callback for every inbound Message and sends
  nothing of its own (an empty reply stream), matching the spec's
  non-participation mode. Independent of RequestHandler, since Collaborate is a
  broadcast channel rather than a request/response operation.

Not yet implemented (spec is still draft): Agent Card extension declaration,
formal EOS/non-participation signaling beyond the empty reply stream, and
server-side per-message sender attribution (Context/DecodedStream don't expose
it with the current API; attribution is only available client-side via
MulticastItem, which is what collaborate() uses).

Test: slimrpc_collaborate_broadcasts_to_every_other_member — 3 members each
independently broadcast one intro Message to the other two via collaborate(),
and every other member's register_collaborate listener receives it. Bumps
a2a-slimrpc to 0.2.3; adds serde_json, promotes tokio to a real dependency
(the SLIM stack already requires a tokio runtime).

Signed-off-by: Luca Muscariello <muscariello@ieee.org>
@muscariello
muscariello requested a review from a team as a code owner July 22, 2026 08:02
@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

Consumers that only register a listen-only Collaborate participant (via
register_collaborate) need the attribution key name to read
Message.metadata["slim-src"] themselves, since server-side attribution isn't
populated automatically (see the earlier commit's note on this limitation).

Signed-off-by: Luca Muscariello <muscariello@ieee.org>
@muscariello
muscariello requested a review from msardara July 22, 2026 08:29

@msardara msardara left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ✅

@muscariello
muscariello merged commit 0e64d64 into main Jul 22, 2026
9 checks passed
@muscariello
muscariello deleted the feat/slimrpc-collaborate branch July 22, 2026 08:42
@codecov

codecov Bot commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.95238% with 12 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
a2a-slimrpc/src/client.rs 70.00% 12 Missing ⚠️

📢 Thoughts on this report? Let us know!

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.

2 participants