Skip to content

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

test(orchestration): surface subagent failures in spawn tests

Steven Enamakelfda7684a9783
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_async_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_async_tests.rs
index b10ee75398..fc94804427 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_async_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_subagent_async_tests.rs
@@ -284,7 +284,7 @@ async fn headless_spawn_is_async_and_reports_its_result_to_the_run_log() {
let mut parent = parent_context(workspace.path());
parent.session_id = "headless-spawn-session".into();
parent.on_progress = Some(progress_tx);
- let live = headless_core_backed_parent(workspace.path(), parent);
+ let (live, _core) = headless_core_backed_parent(workspace.path(), parent);
let result = SpawnSubagentTool::new()
.execute_with_live_parent_context(
@@ -317,6 +317,13 @@ async fn headless_spawn_is_async_and_reports_its_result_to_the_run_log() {
output,
..
}) if event_task_id == task_id => break output,
+ Some(crate::progress::AgentProgress::SubagentFailed {
+ task_id: event_task_id,
+ error,
+ ..
+ }) if event_task_id == task_id => {
+ panic!("headless child failed before completion: {error}")
+ }
Some(_) => {}
None => panic!("headless completion progress stream closed"),
}
@@ -362,7 +369,10 @@ async fn headless_spawn_is_async_and_reports_its_result_to_the_run_log() {
fn headless_core_backed_parent(
workspace: &Path,
mut parent: ParentExecutionContext,
-) -> tinyagents_harness::context::RunContext<crate::agent::tinyagents::host::OpenHumanRunContext> {
+) -> (
+ tinyagents_harness::context::RunContext<crate::agent::tinyagents::host::OpenHumanRunContext>,
+ Arc<crate::core::runtime::CoreContext>,
+) {
use crate::core::runtime::{ContextOverlay, CoreContext, DomainSet};
use crate::tools::toolpacks::ToolGroups;
@@ -383,9 +393,12 @@ fn headless_core_backed_parent(
let host = crate::agent::tinyagents::host::OpenHumanRunContext::new()
.with_core(Some(Arc::clone(&core)))
.with_parent(parent.clone());
- tinyagents_harness::context::RunContext::new(
- tinyagents_harness::context::RunConfig::new(parent.session_id),
- host,
+ (
+ tinyagents_harness::context::RunContext::new(
+ tinyagents_harness::context::RunConfig::new(parent.session_id),
+ host,
+ ),
+ core,
)
}
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_continuation_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_continuation_tests.rs
index 4d9f50a9c1..e17f912c10 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_continuation_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/tools_e2e_continuation_tests.rs
@@ -32,7 +32,7 @@ async fn spawn_subagent_with_same_task_key_resumes_paused_job_through_shared_dri
parent
.subagent_tool_ceiling_names
.insert("ask_user_clarification".into());
- let live = core_backed_live_parent(
+ let (live, _core) = core_backed_live_parent(
workspace.path(),
parent,
"continue-paused-e2e",
@@ -237,7 +237,10 @@ fn core_backed_live_parent(
parent: crate::agent::harness::ParentExecutionContext,
session_id: &str,
thread_id: &str,
-) -> tinyagents_harness::context::RunContext<crate::agent::tinyagents::host::OpenHumanRunContext> {
+) -> (
+ tinyagents_harness::context::RunContext<crate::agent::tinyagents::host::OpenHumanRunContext>,
+ Arc<crate::core::runtime::CoreContext>,
+) {
use crate::core::runtime::{ContextOverlay, CoreContext, DomainSet};
use crate::tools::toolpacks::ToolGroups;
@@ -261,9 +264,12 @@ fn core_backed_live_parent(
.with_core(Some(Arc::clone(&core)))
.with_parent(parent);
host_context.thread_id = Some(thread_id.to_owned());
- tinyagents_harness::context::RunContext::new(
- tinyagents_harness::context::RunConfig::new(session_id).with_thread(thread_id),
- host_context,
+ (
+ tinyagents_harness::context::RunContext::new(
+ tinyagents_harness::context::RunConfig::new(session_id).with_thread(thread_id),
+ host_context,
+ ),
+ core,
)
}
@@ -304,7 +310,7 @@ async fn cancelling_a_paused_driver_settles_once_with_its_reason() {
.subagent_tool_ceiling_names
.insert("ask_user_clarification".into());
- let live = core_backed_live_parent(
+ let (live, _core) = core_backed_live_parent(
workspace.path(),
parent,
"paused-cancel-rpc-parent",