From 9e16a1db2453eec1b4956717a2067f88bf7b9ea0 Mon Sep 17 00:00:00 2001 From: Ben Brandt Date: Sat, 14 Nov 2026 16:04:13 +0100 Subject: [PATCH 1/2] ci: fix the build with Cargo 1.100's unused dependency lints Cargo 1.100 adds two manifest lints that warn by default. CI denies warnings, so the Build job and every feature powerset job fail on `main`. - `cargo::unused_dependencies` flags `agent-client-protocol-rmcp` in the cookbook. Only rustdoc links and doctests use it, and rustdoc resolves links against regular dependencies only, so it has to stay one. Name the crate with `use agent_client_protocol_rmcp as _;`. - `cargo::unused_workspace_dependencies` flags nine workspace dependencies in the powerset jobs. `cargo hack --no-dev-deps` removes dev-dependencies from the manifests while it runs, and only dev-dependencies inherit those entries. Deny compiler warnings only in that step (`CARGO_BUILD_WARNINGS=warn`, `RUSTFLAGS=-D warnings`). The Build job still denies Cargo's warnings for the real manifests. --- .github/workflows/ci.yml | 8 ++++++++ src/agent-client-protocol-cookbook/src/lib.rs | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2a7210f1..21126176 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -177,4 +177,12 @@ jobs: # Depth 2 covers every remaining individual feature and pair, while the # regular CI all-features tests cover their full union without making # this matrix grow exponentially. + env: + # `--no-dev-deps` removes dev-dependencies from the manifests while + # cargo-hack runs. Cargo then reports the workspace dependencies that + # only dev-dependencies inherit as unused, and denying all warnings + # would fail every combination. Deny compiler warnings only. The + # Build job still denies Cargo's warnings for the real manifests. + CARGO_BUILD_WARNINGS: warn + RUSTFLAGS: -D warnings run: cargo hack check --workspace --feature-powerset --depth 2 --exclude-features default,unstable,wasm_js --no-dev-deps --partition ${{ matrix.partition }} diff --git a/src/agent-client-protocol-cookbook/src/lib.rs b/src/agent-client-protocol-cookbook/src/lib.rs index d34bda36..e7df35e1 100644 --- a/src/agent-client-protocol-cookbook/src/lib.rs +++ b/src/agent-client-protocol-cookbook/src/lib.rs @@ -56,6 +56,10 @@ //! [`Proxy`]: agent_client_protocol::Proxy //! [`ConnectTo`]: agent_client_protocol::ConnectTo +// Only rustdoc links and doctests use this crate. Name it here so that Cargo +// does not report the dependency as unused. +use agent_client_protocol_rmcp as _; + pub mod ordered_application_dispatch; pub mod v2_session_coordination { From c858527b1a0e041f5c600b06b721d5f666e23086 Mon Sep 17 00:00:00 2001 From: Ben Brandt Date: Sat, 14 Nov 2026 16:20:28 +0100 Subject: [PATCH 2/2] build: drop --no-dev-deps and make the rmcp crate's dependencies optional Replace the relaxed warning settings on the feature powerset step. `cargo hack --no-dev-deps` removes dev-dependencies from the manifests while it runs, which is what made Cargo report nine workspace dependencies as unused. The flag is not needed with resolver 3: dev-dependencies do not add features to the library and binary targets the job checks. Remove it and keep denying every warning. With every warning denied, the job reports that `agent-client-protocol-rmcp` declares dependencies it does not use without `rmcp_3`, where the crate is empty. Make them optional and enable them from `rmcp_3`. The `unstable_mcp_over_acp` passthrough becomes `agent-client-protocol?/unstable_mcp_over_acp`, so on its own it no longer enables the core crate's feature. --- .github/workflows/ci.yml | 16 +++++----- md/features.md | 2 +- src/agent-client-protocol-rmcp/Cargo.toml | 38 ++++++++++++++++------- src/agent-client-protocol-rmcp/README.md | 3 +- 4 files changed, 36 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 21126176..b2f7e27a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -177,12 +177,10 @@ jobs: # Depth 2 covers every remaining individual feature and pair, while the # regular CI all-features tests cover their full union without making # this matrix grow exponentially. - env: - # `--no-dev-deps` removes dev-dependencies from the manifests while - # cargo-hack runs. Cargo then reports the workspace dependencies that - # only dev-dependencies inherit as unused, and denying all warnings - # would fail every combination. Deny compiler warnings only. The - # Build job still denies Cargo's warnings for the real manifests. - CARGO_BUILD_WARNINGS: warn - RUSTFLAGS: -D warnings - run: cargo hack check --workspace --feature-powerset --depth 2 --exclude-features default,unstable,wasm_js --no-dev-deps --partition ${{ matrix.partition }} + # + # There is no `--no-dev-deps`. That flag removes dev-dependencies from + # the manifests while cargo-hack runs, so Cargo reports the workspace + # dependencies only they inherit as unused. It is also not needed: + # with resolver 3, dev-dependencies do not add features to the + # library and binary targets this command checks. + run: cargo hack check --workspace --feature-powerset --depth 2 --exclude-features default,unstable,wasm_js --partition ${{ matrix.partition }} diff --git a/md/features.md b/md/features.md index 786b7336..b2e68378 100644 --- a/md/features.md +++ b/md/features.md @@ -77,7 +77,7 @@ Internal crates request only the core capabilities they use: | --- | --- | | HTTP client/server | None; transport sides remain opt-in through `client` and `server` | | MCP-over-ACP polyfill | `unstable_mcp_over_acp`, with independent draft-v2 and session-fork passthrough features | -| rmcp integration | `schemars`; one feature per rmcp major version (`rmcp_3`), and an `unstable_mcp_over_acp` passthrough feature. It has no draft-v2 feature: enable `unstable_protocol_v2` on `agent-client-protocol` itself | +| rmcp integration | `schemars`; one feature per rmcp major version (`rmcp_3`), and an `unstable_mcp_over_acp` passthrough feature. The core crate is only a dependency with an rmcp version feature, so the passthrough does nothing on its own. It has no draft-v2 feature: enable `unstable_protocol_v2` on `agent-client-protocol` itself | | Conductor | `process`, `stdio`, and `unstable_mcp_over_acp` for launching components, serving stdio, and classifying MCP traces | | YOPO | `process` for launching the agent | | Test utilities | `process` and `stdio` for fixture binaries and launch helpers | diff --git a/src/agent-client-protocol-rmcp/Cargo.toml b/src/agent-client-protocol-rmcp/Cargo.toml index b411bdfb..42644dea 100644 --- a/src/agent-client-protocol-rmcp/Cargo.toml +++ b/src/agent-client-protocol-rmcp/Cargo.toml @@ -18,11 +18,25 @@ rustdoc-args = ["--cfg", "docsrs"] # No rmcp version is enabled by default. Each supported rmcp major version has # its own feature and module; features are additive. default = [] -# rmcp 3.x integration in the `rmcp_3` module. -rmcp_3 = ["dep:rmcp_3"] +# rmcp 3.x integration in the `rmcp_3` module. Without an rmcp version feature +# the crate is empty, so the dependencies the integration uses are optional +# and enabled here. +rmcp_3 = [ + "dep:rmcp_3", + "dep:agent-client-protocol", + "dep:futures", + "dep:futures-concurrency", + "dep:schemars", + "dep:serde", + "dep:serde_json", + "dep:tokio", + "dep:tokio-util", +] # Passthrough feature for the core crate's `unstable_mcp_over_acp`. The native -# MCP-over-ACP path follows the core feature however it is enabled. -unstable_mcp_over_acp = ["agent-client-protocol/unstable_mcp_over_acp"] +# MCP-over-ACP path follows the core feature however it is enabled. On its own +# it enables nothing, because the core crate is only a dependency with an +# rmcp version feature. +unstable_mcp_over_acp = ["agent-client-protocol?/unstable_mcp_over_acp"] [[example]] name = "with_mcp_server" @@ -34,16 +48,16 @@ name = "stateless_native_mcp" required-features = ["rmcp_3", "unstable_mcp_over_acp"] [dependencies] -agent-client-protocol = { workspace = true, features = ["schemars"] } -futures.workspace = true -futures-concurrency.workspace = true +agent-client-protocol = { workspace = true, optional = true, features = ["schemars"] } +futures = { workspace = true, optional = true } +futures-concurrency = { workspace = true, optional = true } # Keep the version and features in step with the workspace `rmcp` entry. rmcp_3 = { package = "rmcp", version = "3.4.0", optional = true, default-features = false, features = ["server", "schemars"] } -schemars.workspace = true -serde.workspace = true -serde_json.workspace = true -tokio = { workspace = true, features = ["io-util", "macros", "rt"] } -tokio-util = { workspace = true, features = ["rt"] } +schemars = { workspace = true, optional = true } +serde = { workspace = true, optional = true } +serde_json = { workspace = true, optional = true } +tokio = { workspace = true, optional = true, features = ["io-util", "macros", "rt"] } +tokio-util = { workspace = true, optional = true, features = ["rt"] } [dev-dependencies] # The `stateless_native_mcp` example attaches a server to a v2 proxy. diff --git a/src/agent-client-protocol-rmcp/README.md b/src/agent-client-protocol-rmcp/README.md index e5daeb83..27f1f0b9 100644 --- a/src/agent-client-protocol-rmcp/README.md +++ b/src/agent-client-protocol-rmcp/README.md @@ -10,7 +10,8 @@ Rust, serve them directly, or attach them to an ACP proxy. Each supported rmcp major version has its own module behind a matching Cargo feature. No rmcp feature is enabled by default; without one, this crate is -empty. Enable the feature for the rmcp major version your application uses: +empty and has no dependencies. Enable the feature for the rmcp major version +your application uses: | Feature | Module | rmcp | | -------- | ------------------------------------- | ---- |