Skip to content

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

test(orchestration): cover detached child cancellation in stopped async spawn

Steven Enamakelc8a817df584c
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 f4dd329151..4e908f5373 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
@@ -387,6 +387,14 @@ async fn stopped_async_spawn_is_refused_before_progress_or_session_effects() {
&dispatch,
thread_id,
);
+ let detached_data = live.data.detached_child();
+ let detached = live
+ .child(
+ tinyagents_harness::context::RunConfig::new("stopped-async-child"),
+ detached_data.clone(),
+ )
+ .expect("detached child context")
+ .with_cancellation(detached_data.cancellation.clone());
let result = crate::agent::orchestration::tools::SpawnAsyncSubagentTool::new()
.execute_with_live_parent_context(
@@ -397,10 +405,7 @@ async fn stopped_async_spawn_is_refused_before_progress_or_session_effects() {
}),
None,
live.data.child(),
- Some(live.child(
- tinyagents_harness::context::RunConfig::new("stopped-async-child"),
- live.data.detached_child(),
- ).expect("detached child context")),
+ detached,
)
.await
.expect("tool execution");