Skip to content

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

fix(agent): clarify subagent control errors and use typed turn stop in tests

Steven Enamakela9f485b56d4b
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/subagent_control_surfaces.rs b/crates/openhuman-core/src/agent/orchestration/tools/subagent_control_surfaces.rs
index 6ff5e2878b..729d779a9f 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/subagent_control_surfaces.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/subagent_control_surfaces.rs
@@ -140,7 +140,7 @@ impl Tool for WaitSubagentTool {
));
}
Ok(ToolResult::error(
- "wait_subagent requires a live harness control dispatch",
+ "wait_subagent called outside of an agent turn",
))
}
}
@@ -200,7 +200,7 @@ impl Tool for SteerSubagentTool {
return Ok(ToolResult::error("steer_subagent: `message` is required"));
}
Ok(ToolResult::error(
- "steer_subagent requires a live harness control dispatch",
+ "steer_subagent called outside of an agent turn",
))
}
}
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 8af49a55ad..ab05d26ec4 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
@@ -73,7 +73,7 @@ async fn committed_progress_uses_each_turns_receipt_sender() {
#[tokio::test]
async fn committed_progress_carries_the_sidecar_stop_on_turn_completed() {
use crate::progress::AgentProgress;
- use tinyagents_harness::turn_stop::TurnStopKind;
+ use tinyagents_harness::{TurnFailureClass, TurnStop, turn_stop::TurnStopKind};
use tinyagents_runtime::{
CommitReceipt, ResumeMode, SessionTurnOutcome, TranscriptTurnOptions,
};
@@ -81,11 +81,11 @@ 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::session_host::stop_summary::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(TurnStop::breaker_with_cause(
+ "Stopping after 2 attempts",
+ TurnFailureClass::new("uncertain_side_effect"),
+ Some("web_answer_tool".to_owned()),
+ ));
let receipt = CommitReceipt {
outcome: SessionTurnOutcome {
history: Vec::new(),