Skip to content

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

fix(orchestration): preserve subagent results when parallel collection fails

Steven Enamakela1d199ec4bbe
diff --git a/crates/openhuman-core/src/agent/orchestration/spawn_parallel_graph/collect.rs b/crates/openhuman-core/src/agent/orchestration/spawn_parallel_graph/collect.rs
index 337a29bded..a64076a6a9 100644
--- a/crates/openhuman-core/src/agent/orchestration/spawn_parallel_graph/collect.rs
+++ b/crates/openhuman-core/src/agent/orchestration/spawn_parallel_graph/collect.rs
@@ -79,6 +79,7 @@ pub(crate) async fn project_spawn_parallel_result(
changed_files,
dirty_status,
emit_lifecycle_effects,
+ error,
..
} = result;
if !emit_lifecycle_effects {
@@ -115,7 +116,11 @@ pub(crate) async fn project_spawn_parallel_result(
worktree_path: worktree_path.clone(),
changed_files: changed_files.clone(),
dirty_status: *dirty_status,
- stop: None,
+ // An incomplete worker was stopped early (breaker /
+ // cap); its span closes at WARNING with that stop.
+ stop: matches!(result.status, ParallelAgentStatus::Incomplete)
+ .then(|| TurnStop::from_incomplete_reason(error.as_deref().unwrap_or("")))
+ ,
})
.await
{
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent.rs b/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent.rs
index 6c3cdc93de..d8b0d7a946 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/spawn_async_subagent.rs
@@ -8,6 +8,7 @@ use super::subagent_abort_report::AbortReport;
use crate::agent::harness::definition::AgentDefinitionRegistry;
use crate::agent::orchestration::fleet_tools::FleetToolSet;
use crate::agent::orchestration::running_subagents;
+use crate::agent::orchestration::tools::dispatch::incomplete_stop;
use crate::agent::orchestration::subagent_sessions::{
self, DurableSubagentStatus, SubagentSessionSelector, SubagentSessionStore,
SubagentSessionUpsert,
diff --git a/crates/openhuman-core/src/agent/subagent_host/ops/runner.rs b/crates/openhuman-core/src/agent/subagent_host/ops/runner.rs
index 2eeb4a694c..90dc0dae81 100644
--- a/crates/openhuman-core/src/agent/subagent_host/ops/runner.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/ops/runner.rs
@@ -1090,7 +1090,7 @@ async fn run_typed_mode(
// result + blocker instead of treating the summary as a finished answer
// or re-spinning the identical delegation (#4096).
crate::agent::subagent_host::types::SubagentRunStatus::Incomplete {
- reason: "reached its tool-call limit before finishing".into(),
+ reason: crate::agent::turn_stop::SUBAGENT_ITERATION_CAP_REASON.into(),
}
} else {
// A clean final response. (An `ask_user_clarification` early-exit is