feat(slimrpc)!: migrate a2a-slimrpc onto native agntcy-slim-rpc - #104
Conversation
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>
There was a problem hiding this comment.
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.
| let normalized = target | ||
| .trim() | ||
| .strip_prefix("slimrpc://") | ||
| .or_else(|| target.trim().strip_prefix("slim://")) | ||
| .unwrap_or(target.trim()) | ||
| .trim_start_matches('/'); |
There was a problem hiding this comment.
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.
| 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('/'); |
Codecov Report❌ Patch coverage is
📢 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>
b051b99 to
7621e18
Compare
`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>
…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>
Repoints
a2a-slimrpcoff the UniFFI shim (agntcy-slim-bindings1.3.x) onto the nativeagntcy-slim-rpc2.0.0-alpha.3, removing the entire UniFFI stack from the A2A dependency chain.slim_bindings; addslim_rpc+ nativeslim_service(App),slim_datapath(ProtoName),slim_auth(auth provider/verifier).Channel/Server/Context/RpcError/RpcCode/StreamMessage) now fromslim_rpc.SlimApp = slim_service::app::App<AuthProvider, AuthVerifier>,slim_datapath::api::ProtoName.parse_slimrpc_targetsplitsorg/namespace/agent→ProtoName::from_strings.Service::create_appinstead of the FFI constructor.All unit + e2e tests pass;
clippy -D warnings+fmtclean.BREAKING:
SlimRpcTransport/Factorynow take nativeApp/Nameinstead of the FFI types →a2a-slimrpc0.2.0. Unblocks the SHADI SLIM-v2 migration (step D).