Skip to content

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

fix(test): fail loudly if the built-in agent registry does not load\n\n`load_builtins().unwrap_or_default()` absorbed a registry load failure into an\nempty delegate set. Every pack delegate — `do_crypto`, `build_workflow`,\n`run_skill`, `setup_skills`, `use_mcp_server`, `setup_mcp_server`,\n`discover_workflows` — would then resolve against nothing and be reported as a\nphantom name. A broken registry would have surfaced as a list of fake stale\ntools: the exact failure this test exists to report, raised for a reason that\nhas nothing to do with a stale table.\n\n`load_builtins` documents that built-in TOML is baked into the binary and must\nalways parse, so an `Err` is a broken invariant, not a condition to swallow.\n`.expect` with a diagnostic naming the consequence.\n\nFound by tinysweeper on #6217.\n\nVerified: product features pass; CI's gates-off command\n(`--no-default-features --lib -- tools::ops::tests::`) 72 passed, 0 failed;\nfull `tools::` + `agent::registry` 1904 passed, 0 failed.\n

M3gA-Mind2e29fbae159f
diff --git a/src/openhuman/tools/ops_tests_part_01_tests.rs b/src/openhuman/tools/ops_tests_part_01_tests.rs
index 29eef60901..fd9dea35ad 100644
--- a/src/openhuman/tools/ops_tests_part_01_tests.rs
+++ b/src/openhuman/tools/ops_tests_part_01_tests.rs
@@ -201,9 +201,17 @@ fn every_packed_tool_name_resolves_to_a_registered_tool() {
// absent here. `owners` holds agent ids (`crypto_agent`); the names that
// appear in `tools` are delegate names (`do_crypto`), so resolve them from
// the agent registry rather than from `owners`.
+ //
+ // `.expect`, not `.unwrap_or_default()`: an empty delegate set would make
+ // EVERY pack delegate (`do_crypto`, `build_workflow`, `run_skill`, …) report
+ // as missing, so a registry that failed to load would surface as a list of
+ // phantom names — the exact failure this test exists to report, raised for
+ // the wrong reason. `load_builtins` documents that built-in TOML is baked
+ // into the binary and must always parse, so an `Err` here is a broken
+ // invariant worth failing loudly on rather than absorbing.
let delegates: std::collections::HashSet<String> =
crate::openhuman::agent::registry::agents::load_builtins()
- .unwrap_or_default()
+ .expect("built-in agent registry must load; without it every pack delegate would be reported as a phantom name")
.into_iter()
.filter_map(|d| d.delegate_name)
.collect();