Skip to content

fix(slimrpc): migrate a2a-slimrpc onto slim 0.14 native crates - #109

Merged
muscariello merged 2 commits into
mainfrom
chore/slim-0.14-jwks-fix
Jul 21, 2026
Merged

fix(slimrpc): migrate a2a-slimrpc onto slim 0.14 native crates#109
muscariello merged 2 commits into
mainfrom
chore/slim-0.14-jwks-fix

Conversation

@muscariello

Copy link
Copy Markdown
Member

Why

The slim 0.14 release carries a fix in agntcy-slim-auth for JWKS multi-key key selection (a token now verifies against the correct key in a multi-key allow-list instead of only the first — agntcy/slim#1882 / #1883). Consuming it requires the whole slim family at 0.14, and slim-rpc alpha.7 (the only rpc that depends on auth ^0.14) changed its public API — so this is a real migration, not just a version bump.

Changes

Bump the workspace slim pins to the 0.14 family (auth 0.14.0, rpc 2.0.0-alpha.7, service 0.11.6, datapath 0.16.7, config 0.12.6) and migrate a2a-slimrpc to the new rpc API:

  • client: Channel::call_unary_async / call_unary_stream_asyncChannel::unary / unary_stream (now typed over Encoder/Decoder; used here with pass-through Vec<u8>). unary_stream returns a &self-bound stream, so it's driven inside an async_stream generator that owns a channel clone, keeping the Transport stream 'static.
  • server: register_unary_unary_internal / register_unary_stream_internal → the now-public register_unary_unary / register_unary_stream.
  • tests: Server::new_internal / serve_async / shutdown_asyncServer::new / serve / shutdown.

The public API of a2a-slimrpc (SlimRpcTransport, SlimRpcHandler) is unchanged. Bumps a2a-slimrpc to 0.2.2; adds async-stream.

Test

cargo test -p a2a-slimrpc — 15 unit + 3 e2e (live SLIM round-trip incl. streaming) pass; clippy --all-targets clean; fmt clean; workspace builds.

Bump the slim family to the 0.14 release (auth 0.14.0, rpc 2.0.0-alpha.7,
service 0.11.6, datapath 0.16.7, config 0.12.6) so a2a-slimrpc picks up the
JWKS multi-key key-selection fix in agntcy-slim-auth (a token verifies against
the right key in a multi-key allow-list instead of only the first).

slim-rpc alpha.7 changed the public API, so migrate to it:
- client: `Channel::call_unary_async` / `call_unary_stream_async` ->
  `Channel::unary` / `unary_stream` (typed over `Encoder`/`Decoder`, used here
  with pass-through `Vec<u8>`). `unary_stream` returns a `&self`-bound stream, so
  drive it inside an `async_stream` generator owning a channel clone to keep the
  returned `Transport` stream `'static`.
- server: `register_unary_unary_internal` / `register_unary_stream_internal` ->
  the now-public `register_unary_unary` / `register_unary_stream`.
- tests: `Server::new_internal`/`serve_async`/`shutdown_async` ->
  `Server::new`/`serve`/`shutdown`.

Public API of a2a-slimrpc (SlimRpcTransport, SlimRpcHandler) is unchanged.
Bumps a2a-slimrpc to 0.2.2. Adds async-stream. All unit + e2e tests pass.

Signed-off-by: Luca Muscariello <muscariello@ieee.org>
@muscariello
muscariello requested a review from a team as a code owner July 21, 2026 07:32

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request updates the a2a-slimrpc crate to adapt to the new slim_rpc API, replacing internal and async-suffixed methods (such as call_unary_async and register_unary_unary_internal) with their simplified counterparts. It also introduces the async-stream dependency to resolve lifetime issues when returning streams from SlimRpcTransport. The review feedback highlights a discrepancy between the dependency versions specified in Cargo.toml and those locked in Cargo.lock (specifically for slim_rpc, slim_service, and slim_datapath), suggesting they be aligned.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread Cargo.toml Outdated
Comment on lines +75 to +80
slim_rpc = { package = "agntcy-slim-rpc", version = "2.0.0-alpha.6" }
slim_config = { package = "agntcy-slim-config", version = "0.12.6" }
slim_service = { package = "agntcy-slim-service", version = "0.11.5", features = [
"session",
] }
slim_datapath = { package = "agntcy-slim-datapath", version = "0.16.5" }
slim_auth = { package = "agntcy-slim-auth", version = "0.13.0" }
slim_datapath = { package = "agntcy-slim-datapath", version = "0.16.6" }

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

There is a version discrepancy between the dependencies specified in Cargo.toml and those locked in Cargo.lock (and mentioned in the PR description).

Specifically:

  • slim_rpc is specified as 2.0.0-alpha.6 but locked as 2.0.0-alpha.7.
  • slim_service is specified as 0.11.5 but locked as 0.11.6.
  • slim_datapath is specified as 0.16.6 but locked as 0.16.7.

Updating these to match the locked versions ensures consistency and avoids potential dependency resolution issues for downstream consumers.

Suggested change
slim_rpc = { package = "agntcy-slim-rpc", version = "2.0.0-alpha.6" }
slim_config = { package = "agntcy-slim-config", version = "0.12.6" }
slim_service = { package = "agntcy-slim-service", version = "0.11.5", features = [
"session",
] }
slim_datapath = { package = "agntcy-slim-datapath", version = "0.16.5" }
slim_auth = { package = "agntcy-slim-auth", version = "0.13.0" }
slim_datapath = { package = "agntcy-slim-datapath", version = "0.16.6" }
slim_rpc = { package = "agntcy-slim-rpc", version = "2.0.0-alpha.7" }
slim_config = { package = "agntcy-slim-config", version = "0.12.6" }
slim_service = { package = "agntcy-slim-service", version = "0.11.6", features = [
"session",
] }
slim_datapath = { package = "agntcy-slim-datapath", version = "0.16.7" }

@muscariello
muscariello requested a review from msardara July 21, 2026 07:35
@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Specify rpc 2.0.0-alpha.7 / service 0.11.6 / datapath 0.16.7 to match the
lockfile. The previous minimums (alpha.6 / 0.11.5 / 0.16.6) could not resolve
alongside slim_auth 0.14.0 anyway (they cap at auth <0.14), so the manifest now
honestly reflects what the auth 0.14 pin forces. Addresses PR review feedback.

Signed-off-by: Luca Muscariello <muscariello@ieee.org>
@muscariello
muscariello merged commit d182440 into main Jul 21, 2026
10 checks passed
@muscariello
muscariello deleted the chore/slim-0.14-jwks-fix branch July 21, 2026 09: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.

2 participants