Skip to content

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

test(agent-registry): tighten tool assertions for trigger_reactor and morning_briefing

Steven Enamakel4451d96964c5
diff --git a/crates/openhuman-core/src/agent/registry/agents/loader_tests_builtin_registration_tests.rs b/crates/openhuman-core/src/agent/registry/agents/loader_tests_builtin_registration_tests.rs
index 603039d67c..002055ea73 100644
--- a/crates/openhuman-core/src/agent/registry/agents/loader_tests_builtin_registration_tests.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/loader_tests_builtin_registration_tests.rs
@@ -72,9 +72,11 @@ fn trigger_reactor_has_agentic_hint_and_narrow_tools() {
tools.iter().any(|t| t == "memory_store"),
"trigger_reactor needs memory_store"
);
+ // A worker with no `[subagents]` allowlist can never dispatch a
+ // spawn, so listing the tool only advertised a dead route.
assert!(
- tools.iter().any(|t| t == "spawn_subagent"),
- "trigger_reactor needs spawn_subagent for escalation"
+ !tools.iter().any(|t| t == "spawn_subagent"),
+ "trigger_reactor cannot escalate by spawning; it must not list spawn_subagent"
);
// No shell / file_write — reactor does not execute code.
assert!(!tools.iter().any(|t| t == "shell"));
diff --git a/crates/openhuman-core/src/agent/registry/agents/loader_tests_specialist_agents_tests.rs b/crates/openhuman-core/src/agent/registry/agents/loader_tests_specialist_agents_tests.rs
index ccb74bb639..5d9efb5d0d 100644
--- a/crates/openhuman-core/src/agent/registry/agents/loader_tests_specialist_agents_tests.rs
+++ b/crates/openhuman-core/src/agent/registry/agents/loader_tests_specialist_agents_tests.rs
@@ -258,7 +258,20 @@ fn archivist_runs_in_background() {
fn morning_briefing_is_read_only() {
let def = find("morning_briefing");
assert_eq!(def.sandbox_mode, SandboxMode::ReadOnly);
- assert!(matches!(def.tools, ToolScope::Wildcard));
+ // A named belt, not a wildcard: a cron-driven read-only job has no use
+ // for every registered tool.
+ match &def.tools {
+ ToolScope::Named(tools) => {
+ for required in ["memory_tree", "composio_execute", "tool_search", "current_time"] {
+ assert!(
+ tools.iter().any(|t| t == required),
+ "morning_briefing needs `{required}`"
+ );
+ }
+ assert!(!tools.iter().any(|t| t == "shell" || t == "file_write"));
+ }
+ ToolScope::Wildcard => panic!("morning_briefing must have a named belt"),
+ }
// The brief pulls its own last-24h memory via the `memory_tree`
// `cover_window` tool, so the stale all-time memory blob is suppressed.
assert!(def.omit_memory_context);