Skip to content

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

feat(spawn_parallel): carry typed failure cause into stop summaries

Steven Enamakel64268022dbdc
diff --git a/crates/openhuman-core/src/agent/orchestration/spawn_parallel/collect.rs b/crates/openhuman-core/src/agent/orchestration/spawn_parallel/collect.rs
index 83f6b1a00a..d4600999f0 100644
--- a/crates/openhuman-core/src/agent/orchestration/spawn_parallel/collect.rs
+++ b/crates/openhuman-core/src/agent/orchestration/spawn_parallel/collect.rs
@@ -119,6 +119,7 @@ pub(crate) async fn project_spawn_parallel_result(
stop: matches!(result.status, ParallelAgentStatus::Incomplete).then(|| {
crate::agent::session_host::stop_summary::stop_from_incomplete(
error.as_deref().unwrap_or(""),
+ result.failure_cause.clone(),
)
}),
})
diff --git a/crates/openhuman-core/src/agent/orchestration/spawn_parallel/dispatch.rs b/crates/openhuman-core/src/agent/orchestration/spawn_parallel/dispatch.rs
index c598de3045..5e28287872 100644
--- a/crates/openhuman-core/src/agent/orchestration/spawn_parallel/dispatch.rs
+++ b/crates/openhuman-core/src/agent/orchestration/spawn_parallel/dispatch.rs
@@ -92,6 +92,7 @@ async fn create_spawn_parallel_worktree(
status: ParallelAgentStatus::Failed,
output: None,
error: Some(format!("worktree isolation failed: {err}")),
+ failure_cause: None,
awaiting_question: None,
checkpoint_path: None,
ownership: task.ownership.clone(),
@@ -122,6 +123,7 @@ async fn create_spawn_parallel_worktree(
error: Some(
"worktree isolation requested but action_dir is unavailable".to_string(),
),
+ failure_cause: None,
awaiting_question: None,
checkpoint_path: None,
ownership: task.ownership.clone(),
@@ -204,6 +206,7 @@ pub(crate) async fn stage_spawn_parallel_workers_from_defs(
status: ParallelAgentStatus::Failed,
output: None,
error: Some(rejection.error),
+ failure_cause: None,
awaiting_question: None,
checkpoint_path: None,
ownership: rejection.ownership,
diff --git a/crates/openhuman-core/src/agent/orchestration/spawn_parallel/types.rs b/crates/openhuman-core/src/agent/orchestration/spawn_parallel/types.rs
index 07467f90ce..0feb2e4b24 100644
--- a/crates/openhuman-core/src/agent/orchestration/spawn_parallel/types.rs
+++ b/crates/openhuman-core/src/agent/orchestration/spawn_parallel/types.rs
@@ -74,6 +74,9 @@ pub(crate) struct ParallelAgentResult {
pub(crate) output: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub(crate) error: Option<String>,
+ /// Typed terminal cause retained for incomplete-result projections.
+ #[serde(skip)]
+ pub(crate) failure_cause: Option<tinyagents_harness::no_progress::ClassifiedStopCause>,
#[serde(skip_serializing_if = "Option::is_none")]
pub(crate) awaiting_question: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
diff --git a/crates/openhuman-core/src/agent/orchestration/spawn_parallel/workers.rs b/crates/openhuman-core/src/agent/orchestration/spawn_parallel/workers.rs
index a37b01d582..26f5016b43 100644
--- a/crates/openhuman-core/src/agent/orchestration/spawn_parallel/workers.rs
+++ b/crates/openhuman-core/src/agent/orchestration/spawn_parallel/workers.rs
@@ -187,6 +187,7 @@ async fn run_one_parallel_task(
status,
output: Some(outcome.output),
error,
+ failure_cause: outcome.failure_cause.clone(),
awaiting_question,
checkpoint_path,
ownership: task.ownership,
@@ -215,6 +216,7 @@ async fn run_one_parallel_task(
status: ParallelAgentStatus::Failed,
output: None,
error: Some(err.to_string()),
+ failure_cause: None,
awaiting_question: None,
checkpoint_path: None,
ownership: task.ownership,