Skip to content

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

refactor(subagent_host): extract bundle failure lookup helper

Steven Enamakel81f87c2d0ef5
diff --git a/crates/openhuman-core/src/agent/subagent_host/lifecycle.rs b/crates/openhuman-core/src/agent/subagent_host/lifecycle.rs
index 99a07d45b8..92e0fb3c41 100644
--- a/crates/openhuman-core/src/agent/subagent_host/lifecycle.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/lifecycle.rs
@@ -166,11 +166,6 @@ pub(crate) async fn spawn_async_via_driver_tool(
decode_driver_job_result(tool_result, &bundle, &task_key)
}
-type DriverCompletion = Arc<
- dyn Fn(&str, Result<tinyagents_orchestration::subagent::SubagentOutcome, String>)
- + Send
- + Sync,
->;
type HostCompletion = Arc<dyn Fn(&str, Result<SubagentRunOutcome, String>) + Send + Sync>;
async fn invoke_async_spawn_driver_tool(
@@ -333,6 +328,17 @@ fn decode_driver_job_result(
})
}
+fn bundle_failure_for_key(
+ bundle: &OpenHumanDriverBundle,
+ task_key: &SubagentTaskKey,
+) -> Option<SubagentRunError> {
+ bundle
+ .failures
+ .lock()
+ .unwrap_or_else(|poisoned| poisoned.into_inner())
+ .remove(task_key)
+}
+
/// Recover the original durable key and complete host pause payload from the
/// safe task-id index written at the pause persistence boundary.