Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(test): gate the pack-resolution guard by Cargo feature\n\nThe guard's comment claimed a feature-gated name was a legitimate skip; the\ncode iterated every pack unconditionally, so it only passed because\n`product-features.sh` enables `web3`, `documents` and `voice`. None of those\nthree is in `default` (Cargo.toml `default = [...]`), so a bare\n`cargo test` failed with every crypto / documents / audio tool reported\nmissing — including the real ones. Caught by Codex on #6217.\n\n`pack_is_assertable` now gates those three packs on their features and keeps\nthe `composio` exemption. The map is explicit rather than inferred from "zero\ntools resolved": a pack whose every name is stale also resolves zero, so\ninferring would silently skip the exact case this test exists to catch. A new\nfeature-gated pack fails here until it is added — loud, which is the right\ndirection for a guard.\n\nVerified both ways: `--features "$(bash scripts/ci/product-features.sh)"\n--no-default-features` (crypto asserted) and bare `cargo test` (crypto skipped)\nboth pass. Revert-check: with the three cfg arms removed, the default-feature\nbuild fails listing all 19 crypto/documents/audio names.\n

M3gA-Minddca25bc26bec
diff --git a/src/openhuman/tools/ops_tests_part_01_tests.rs b/src/openhuman/tools/ops_tests_part_01_tests.rs
index 9f671c3a8e..77a9e90bd8 100644
--- a/src/openhuman/tools/ops_tests_part_01_tests.rs
+++ b/src/openhuman/tools/ops_tests_part_01_tests.rs
@@ -170,9 +170,9 @@ fn every_packed_tool_name_resolves_to_a_registered_tool() {
// `wallet_encode_erc20_transfer`, `wallet_execute_prepared`) whose backing
// functions exist only as `wallet.*` RPC methods, never as agent tools.
//
- // Scoped to the default feature set this test binary is built with: a name
- // compiled out by a disabled feature is a legitimate skip, so the assertion
- // fires only for names no build registers.
+ // Packs whose tools sit behind a non-default Cargo feature are skipped
+ // entirely — see `pack_is_assertable` below. Within an asserted pack every
+ // name must resolve.
let tmp = TempDir::new().unwrap();
let security = Arc::new(SecurityPolicy::default());
let browser = BrowserConfig {
@@ -208,14 +208,36 @@ fn every_packed_tool_name_resolves_to_a_registered_tool() {
.filter_map(|d| d.delegate_name)
.collect();
+ // Whether this build can say anything about a pack at all.
+ //
+ // `PACKS` is unconditional but several packs' tools are behind Cargo
+ // features that are NOT in `default` (`web3`, `documents`, `voice` — see
+ // Cargo.toml `default = [...]`). Under a bare `cargo test` those tools are
+ // never constructed, so iterating them would report every entry as missing
+ // and fail for a reason that has nothing to do with a stale name.
+ //
+ // This map is deliberately explicit rather than inferred from "zero tools
+ // resolved": a pack whose every name is stale would also resolve zero, and
+ // inferring would silently skip exactly the case this test exists to catch.
+ // A new feature-gated pack therefore fails here until it is added below —
+ // loud, which is the correct direction for a guard.
+ fn pack_is_assertable(id: &str) -> bool {
+ match id {
+ // Registered only once the user is signed in to Composio
+ // (`all_composio_agent_tools` returns an empty vec otherwise,
+ // `integrations/composio/tools_part_03.rs:320-323`) — runtime auth
+ // state a unit test cannot satisfy.
+ "composio" => false,
+ "crypto" => cfg!(feature = "web3"),
+ "documents" => cfg!(feature = "documents"),
+ "audio" => cfg!(feature = "voice"),
+ _ => true,
+ }
+ }
+
let mut missing: Vec<String> = Vec::new();
for pack in crate::openhuman::tools::toolpacks::PACKS {
- // `composio`'s tools are registered only once the user is signed in to
- // Composio (`all_composio_agent_tools` returns an empty vec otherwise,
- // `integrations/composio/tools_part_03.rs:320-323`), which is runtime
- // auth state a unit test cannot satisfy. Their absence here says
- // nothing about whether the names are real, so the pack is exempt.
- if pack.id == "composio" {
+ if !pack_is_assertable(pack.id) {
continue;
}
for name in pack.tools {