Skip to content

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

test: box oversized spawn future and reformat test assertions

Steven Enamakel7acf48c0b574
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_tests.rs
index bad1fbf201..c6acc8853e 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_tests.rs
@@ -66,19 +66,21 @@ async fn spawn_subagent_reports_a_stopped_child_as_a_failed_tool_result() {
let live = super::ambient_parent_run_context("stopped-child-test").expect("parent");
let mut run_context = live.data.child();
run_context.progress = Some(progress_tx);
- SpawnSubagentTool::new()
- .execute_with_live_parent_context(
- json!({
- "agent_id": "task_manager_agent",
- "prompt": "List the task sources",
- "model": "test-model",
- "blocking": true
- }),
- None,
- run_context,
- Some(&live),
- )
- .await
+ // Boxed: the inline spawn future is too large for a test thread's
+ // stack (the trait `execute` path boxes it the same way).
+ let tool = SpawnSubagentTool::new();
+ Box::pin(tool.execute_with_live_parent_context(
+ json!({
+ "agent_id": "task_manager_agent",
+ "prompt": "List the task sources",
+ "model": "test-model",
+ "blocking": true
+ }),
+ None,
+ run_context,
+ Some(&live),
+ ))
+ .await
})
.await
.expect("tool execution");
diff --git a/crates/openhuman-core/src/agent/tinyagents/middleware_failure_policy_class_tests.rs b/crates/openhuman-core/src/agent/tinyagents/middleware_failure_policy_class_tests.rs
index ca7e01a0fa..4dc08dfd34 100644
--- a/crates/openhuman-core/src/agent/tinyagents/middleware_failure_policy_class_tests.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/middleware_failure_policy_class_tests.rs
@@ -67,7 +67,11 @@ fn a_policy_block_allows_one_alternative_but_a_user_denial_does_not() {
}
// The user said no, or never answered: asking again only re-prompts them.
assert_eq!(
- recovery_policy("shell", "[policy-denied] The user declined this command", false),
+ recovery_policy(
+ "shell",
+ "[policy-denied] The user declined this command",
+ false
+ ),
Some(("policy", 0))
);
assert_eq!(
@@ -199,7 +203,9 @@ fn production_read_tools() -> Vec<Box<dyn tinytools::Tool>> {
None,
None,
)),
- Box::new(tinytools_std::filesystem::FileReadTool::new(security.clone())),
+ Box::new(tinytools_std::filesystem::FileReadTool::new(
+ security.clone(),
+ )),
Box::new(tinytools_std::filesystem::ListFilesTool::new(security)),
Box::new(crate::desktop::control::tools::DesktopTool::new(
std::sync::Arc::new(crate::config::Config::default()),
@@ -285,7 +291,8 @@ async fn a_failed_browser_task_nudges_toward_its_hint_then_stops_on_a_repeat() {
"{} Browser task failed at step 1: Planning failed Hint: name the exact button",
crate::tools::status::TASK_FAILED_MARKER
);
- let args = serde_json::json!({"action": "task", "goal": "book it", "url": "https://shop.test/"});
+ let args =
+ serde_json::json!({"action": "task", "goal": "book it", "url": "https://shop.test/"});
run_call(&mw, "task-1", "browser", args.clone(), Err(&error)).await;
assert_eq!(drain_pause_count(&handle), 0);
let nudges = drain_nudge_messages(&mw);