Skip to content

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

feat(subagent): carry typed failure cause on incomplete runs

Steven Enamakelb76fc10bdf4a
diff --git a/crates/openhuman-core/src/agent/session_host/runtime_session_tests.rs b/crates/openhuman-core/src/agent/session_host/runtime_session_tests.rs
index c6383e4f20..0902e5b60b 100644
--- a/crates/openhuman-core/src/agent/session_host/runtime_session_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime_session_tests.rs
@@ -74,11 +74,15 @@ async fn committed_progress_carries_the_sidecar_stop_on_turn_completed() {
let (tx, mut rx) = tokio::sync::mpsc::channel(4);
let mut context = crate::agent::tinyagents::host::OpenHumanRunContext::new();
context.progress = Some(tx);
- context.session_sidecar.lock().unwrap().stop =
- Some(crate::agent::turn_projection::breaker_stop(
- "Stopping after 2 attempt(s): failure class `uncertain_side_effect` still blocks \
- operation `web_answer_tool` on `x`. Resolve this blocker before retrying.",
- ));
+ context.session_sidecar.lock().unwrap().stop = Some(
+ crate::agent::turn_projection::breaker_stop_with_cause(
+ tinyagents_harness::no_progress::ClassifiedStopCause {
+ class: "uncertain_side_effect".into(),
+ operation: "web_answer_tool".into(),
+ summary: "classified failure".into(),
+ },
+ ),
+ );
let receipt = CommitReceipt {
outcome: SessionTurnOutcome {
history: Vec::new(),
diff --git a/crates/openhuman-core/src/agent/subagent_host/ops/graph/dispatch.rs b/crates/openhuman-core/src/agent/subagent_host/ops/graph/dispatch.rs
index 31946d5b59..8ca93e2d36 100644
--- a/crates/openhuman-core/src/agent/subagent_host/ops/graph/dispatch.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/ops/graph/dispatch.rs
@@ -517,6 +517,7 @@ pub(in super::super) async fn run_subagent_via_graph(
outcome.hit_cap,
// #4466: propagate a circuit-breaker halt so the runner reports Incomplete.
outcome.breaker_halt,
+ outcome.failure_cause,
))
}
diff --git a/crates/openhuman-core/src/agent/subagent_host/types.rs b/crates/openhuman-core/src/agent/subagent_host/types.rs
index 62bb9d44ff..5b0182a4b6 100644
--- a/crates/openhuman-core/src/agent/subagent_host/types.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/types.rs
@@ -128,6 +128,9 @@ pub enum SubagentRunStatus {
Incomplete {
/// Short, machine-set reason the run stopped short (stuck vs. cap).
reason: String,
+ /// Typed failure classification when the harness has one. It remains
+ /// separate from `reason`, which is user-facing summary text.
+ failure_cause: Option<tinyagents_harness::no_progress::ClassifiedStopCause>,
},
/// Cooperative cancellation won the subagent lifecycle. This is distinct
/// from an incomplete run so callers never publish a completed result for