Skip to content

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

fix(subagent): handle unexpected steer errors

Steven Enamakel734bc2110760
diff --git a/crates/openhuman-core/src/agent/orchestration/subagent_control.rs b/crates/openhuman-core/src/agent/orchestration/subagent_control.rs
index aa57018cf6..94f13695ce 100644
--- a/crates/openhuman-core/src/agent/orchestration/subagent_control.rs
+++ b/crates/openhuman-core/src/agent/orchestration/subagent_control.rs
@@ -15,12 +15,12 @@
//! cancelled.
use crate::core::runtime::DispatchCtx;
-use serde_json::{json, Map, Value};
+use serde_json::{Map, Value, json};
use crate::agent::orchestration::running_subagents::{CancelledSubagent, SteerError};
use crate::agent::orchestration::{background_completions, running_subagents, subagent_sessions};
-use crate::core::all::{ControllerFuture, RegisteredController};
use crate::core::Outcome;
+use crate::core::all::{ControllerFuture, RegisteredController};
use crate::core::{ControllerSchema, FieldSchema, TypeSchema};
use tinyagents_harness::run_queue::QueueLane;
@@ -215,6 +215,7 @@ fn handle_subagent_steer(ctx: DispatchCtx, params: Map<String, Value>) -> Contro
// independently of the caller-supplied task ID.
SteerError::NotOwned => "not_owned",
SteerError::UnsupportedLane => "unsupported_lane",
+ _ => "steer_failed",
};
log::debug!(
target: "subagent_control_rpc",
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/steer_subagent.rs b/crates/openhuman-core/src/agent/orchestration/tools/steer_subagent.rs
index e75ac9af2b..fcea8d931a 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/steer_subagent.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/steer_subagent.rs
@@ -176,7 +176,9 @@ impl SteerSubagentTool {
message.chars().count()
);
- match running_subagents::steer(&dispatch, &resolved_task_id, &parent_session, message, lane).await {
+ match running_subagents::steer(&dispatch, &resolved_task_id, &parent_session, message, lane)
+ .await
+ {
Ok(()) => Ok(ToolResult::success(format!(
"Steered sub-agent `{resolved_task_id}` ({mode}). It will pick this up at its next step. \
Use wait_subagent with its subagent_session_id or task_id to collect its result."
@@ -194,6 +196,9 @@ impl SteerSubagentTool {
Err(SteerError::UnsupportedLane) => Ok(ToolResult::error(
"steer_subagent: only steer and collect messages can be delivered to a running sub-agent",
)),
+ Err(_) => Ok(ToolResult::error(format!(
+ "steer_subagent: unable to deliver a message to sub-agent `{resolved_task_id}`"
+ ))),
}
}
}
diff --git a/vendor/tinyagents b/vendor/tinyagents
index b4266b6838..ac0ad075dc 160000
--- a/vendor/tinyagents
+++ b/vendor/tinyagents
@@ -1 +1 @@
-Subproject commit b4266b68389be43f2fe6756085953e85bb06c869
+Subproject commit ac0ad075dc892050774be106ab761e34e0b2db79