Skip to content

feat(slimrpc)!: migrate a2a-slimrpc onto native agntcy-slim-rpc - #104

Merged
muscariello merged 4 commits into
mainfrom
feat/slimrpc-native-crate
Jul 16, 2026
Merged

feat(slimrpc)!: migrate a2a-slimrpc onto native agntcy-slim-rpc#104
muscariello merged 4 commits into
mainfrom
feat/slimrpc-native-crate

Conversation

@muscariello

Copy link
Copy Markdown
Member

Repoints a2a-slimrpc off the UniFFI shim (agntcy-slim-bindings 1.3.x) onto the native agntcy-slim-rpc 2.0.0-alpha.3, removing the entire UniFFI stack from the A2A dependency chain.

  • Deps: drop slim_bindings; add slim_rpc + native slim_service (App), slim_datapath (ProtoName), slim_auth (auth provider/verifier).
  • RPC types (Channel/Server/Context/RpcError/RpcCode/StreamMessage) now from slim_rpc.
  • App/Name → native: SlimApp = slim_service::app::App<AuthProvider, AuthVerifier>, slim_datapath::api::ProtoName. parse_slimrpc_target splits org/namespace/agentProtoName::from_strings.
  • e2e tests build apps via Service::create_app instead of the FFI constructor.

All unit + e2e tests pass; clippy -D warnings + fmt clean.

BREAKING: SlimRpcTransport/Factory now take native App/Name instead of the FFI types → a2a-slimrpc 0.2.0. Unblocks the SHADI SLIM-v2 migration (step D).

Repoint a2a-slimrpc off the UniFFI shim (agntcy-slim-bindings) onto the
native SlimRPC crate agntcy-slim-rpc (2.0.0-alpha.3), dropping the entire
UniFFI stack from the A2A dependency chain.

- Deps: replace slim_bindings with slim_rpc + native slim_service (App),
  slim_datapath (ProtoName) and slim_auth (auth provider/verifier).
- RPC types (Channel/Server/Context/RpcError/RpcCode/StreamMessage) now
  come from slim_rpc.
- App/Name become native types: SlimApp = slim_service::app::App<AuthProvider,
  AuthVerifier> and slim_datapath::api::ProtoName. parse_slimrpc_target now
  splits the target into org/namespace/agent and builds ProtoName::from_strings.
- e2e tests build apps via slim_service Service::create_app instead of the FFI
  App constructor. All unit + e2e tests pass; clippy -D warnings + fmt clean.

BREAKING CHANGE: SlimRpcTransport/Factory now take native App/Name types
instead of the agntcy-slim-bindings FFI types. Bump to 0.2.0.

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

@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 refactors the a2a-slimrpc crate to replace the monolithic agntcy-slim-bindings dependency with modular slim crates, including agntcy-slim-rpc, agntcy-slim-config, agntcy-slim-service, agntcy-slim-datapath, and agntcy-slim-auth. This involves updating type definitions, imports, and test environments to use the new modular APIs. Feedback is provided regarding a potential parsing failure in parse_slimrpc_target when the target URL contains a trailing slash, along with a suggestion to trim trailing slashes to make the parser more robust.

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 a2a-slimrpc/src/client.rs
Comment on lines 357 to 362
let normalized = target
.trim()
.strip_prefix("slimrpc://")
.or_else(|| target.trim().strip_prefix("slim://"))
.unwrap_or(target.trim())
.trim_start_matches('/');

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

If the target URL contains a trailing slash (e.g., slimrpc://org/namespace/agent/), normalized.split('/') will produce an extra empty component at the end (e.g., ["org", "namespace", "agent", ""]). This causes the slice pattern matching [org, namespace, agent] to fail, resulting in a parsing error. Trimming trailing slashes using .trim_end_matches('/') makes the parser more robust against trailing slashes, which are common in URLs.

Suggested change
let normalized = target
.trim()
.strip_prefix("slimrpc://")
.or_else(|| target.trim().strip_prefix("slim://"))
.unwrap_or(target.trim())
.trim_start_matches('/');
let normalized = target
.trim()
.strip_prefix("slimrpc://")
.or_else(|| target.trim().strip_prefix("slim://"))
.unwrap_or(target.trim())
.trim_start_matches('/')
.trim_end_matches('/');

@muscariello
muscariello requested review from micpapal and msardara July 16, 2026 05:07
@codecov

codecov Bot commented Jul 16, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.47826% with 3 lines in your changes missing coverage. Please review.

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

📢 Thoughts on this report? Let us know!

Newer clippy flags `write!(f, "...", &FIELDS)` in the pbjson-generated serde
code as a useless borrow, failing `-D warnings` on CI (which uses latest
stable; the repo pins no toolchain). Scope an allow to the generated
`protojson` module.

Signed-off-by: Luca Muscariello <muscariello@ieee.org>
@muscariello
muscariello force-pushed the feat/slimrpc-native-crate branch from b051b99 to 7621e18 Compare July 16, 2026 05:32
muscariello added a commit to agntcy/slim that referenced this pull request Jul 16, 2026
`agntcy-slim-config` fails to compile on windows: the `spire` module,
its imports, and the
`AuthenticationConfig`/`TlsSource`/`CaSource`/`TlsConfigError` `Spire`
variants are all `#[cfg(not(target_family = "windows"))]`, but
**`RequiredAuthMethod::Spire`** and its match arm in
`merge_server_requirements` were **not** — so windows hits `unresolved
import crate::auth::spire` + `no variant Spire found`.

Gate the variant and its match arm consistently. The match stays
exhaustive (None/Basic/Jwt) on windows; unix is unchanged.

Surfaced while migrating `a2a-slimrpc` onto the native v2 slim stack
([a2a-rs#104](a2aproject/a2a-rs#104)), whose
windows CI pulls `slim-config`. Host build + clippy + fmt clean (windows
validated via that downstream CI once released).

Signed-off-by: Luca Muscariello <muscariello@ieee.org>
slim-config 0.12.2 cfg-gates RequiredAuthMethod::Spire for windows
(agntcy/slim#1855), fixing the windows compile of the native slim stack
that a2a-slimrpc now depends on. Lock-only bump; host build unchanged.

Signed-off-by: Luca Muscariello <muscariello@ieee.org>

@micpapal micpapal left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

lgtm

muscariello added a commit to agntcy/slim that referenced this pull request Jul 16, 2026
…1859)

Follow-up to #1855. `AuthenticationConfig::Spire` is `cfg(not(windows))`
in slim-config, but `controller`'s `derive_auth` matched on it
unconditionally (`service.rs:217`), so the crate fails to compile on
windows (`no variant Spire`). Compute `auth_is_spire` behind a `cfg`
(false on windows).

Surfaced by a2a-rs windows CI
([#104](a2aproject/a2a-rs#104)) once slim-config
0.12.2 fixed the config-internal refs. control-plane also references the
gated variant but isn't in a2a-slimrpc's tree; controller is the last
one on that path. Host build + clippy + fmt clean.

Signed-off-by: Luca Muscariello <muscariello@ieee.org>
controller 0.11.2 cfg-gates the AuthenticationConfig::Spire match for
windows (agntcy/slim#1859), the last slim crate in a2a-slimrpc's windows
dependency tree that failed to compile. Lock-only; host build unchanged.

Signed-off-by: Luca Muscariello <muscariello@ieee.org>
@muscariello
muscariello merged commit 4a0f7a5 into main Jul 16, 2026
9 of 10 checks passed
@muscariello
muscariello deleted the feat/slimrpc-native-crate branch July 16, 2026 08:34
@github-actions github-actions Bot mentioned this pull request Jul 16, 2026
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