Skip to content

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

fix(delegate): correct agent_id error message to name the delegate tool

Steven Enamakel954c2c149870
diff --git a/crates/openhuman-core/src/agent/orchestration/background_completions_tests.rs b/crates/openhuman-core/src/agent/orchestration/background_completions_tests.rs
index 34287c188b..1978b8c58d 100644
--- a/crates/openhuman-core/src/agent/orchestration/background_completions_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/background_completions_tests.rs
@@ -320,12 +320,32 @@ fn awaiting_input_does_not_dedupe_the_later_completion() {
true,
Some("thread-resume".into()),
));
- record(w, "sess-resume", "sub-resume", "finished after answer", Some("thread-resume"));
+ record(
+ w,
+ "sess-resume",
+ "sub-resume",
+ "finished after answer",
+ Some("thread-resume"),
+ );
let pending = pending_for(w, "thread-resume");
- assert_eq!(pending.len(), 2, "pause notice and final result both survive");
- assert!(pending.iter().any(|record| record.result.text.contains("which repo?")));
- assert!(pending.iter().any(|record| record.result.text == "finished after answer"));
+ assert_eq!(
+ pending.len(),
+ 2,
+ "pause notice and final result both survive"
+ );
+ let pause = pending
+ .iter()
+ .find(|record| record.result.text.contains("which repo?"))
+ .expect("pause notice remains queued");
+ let completion = pending
+ .iter()
+ .find(|record| record.result.text == "finished after answer")
+ .expect("final completion remains queued");
+ assert_ne!(
+ pause.task_id, completion.task_id,
+ "pause has a separate dedupe key"
+ );
}
#[test]
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/delegate_graph.rs b/crates/openhuman-core/src/agent/orchestration/tools/delegate_graph.rs
index dc85844b49..4e95969c44 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/delegate_graph.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/delegate_graph.rs
@@ -206,7 +206,7 @@ impl DelegateGraphTool {
};
let agent_id = match args.get("agent_id").and_then(|v| v.as_str()) {
Some(s) if !s.trim().is_empty() => s.trim().to_string(),
- _ => return Ok(ToolResult::error("delegate_graph: `agent_id` is required.")),
+ _ => return Ok(ToolResult::error("delegate: `agent_id` is required.")),
};
let task = match args.get("task").and_then(|v| v.as_str()) {
Some(s) if !s.trim().is_empty() => s.to_string(),
diff --git a/crates/openhuman-core/src/agent/orchestration/tools/delegate_graph_tests.rs b/crates/openhuman-core/src/agent/orchestration/tools/delegate_graph_tests.rs
index 6db96643ab..f9bcc33272 100644
--- a/crates/openhuman-core/src/agent/orchestration/tools/delegate_graph_tests.rs
+++ b/crates/openhuman-core/src/agent/orchestration/tools/delegate_graph_tests.rs
@@ -4,8 +4,9 @@ use super::*;
async fn validation_errors_name_the_delegate_graph_tool() {
let tool: Arc<dyn Tool> = Arc::new(DelegateGraphTool::new());
let dispatch = DelegateGraphDispatch::new(tool);
- let parent = crate::agent::tinyhumans::host::OpenHumanRunContext::new()
- .into_tinyagents(tinyagents_harness::context::RunConfig::new("delegate-graph-test"));
+ let parent = crate::agent::tinyagents::host::OpenHumanRunContext::new().into_tinyagents(
+ tinyagents_harness::context::RunConfig::new("delegate-graph-test"),
+ );
let result = dispatch
.execute(
diff --git a/crates/openhuman-core/src/modules/mod.rs b/crates/openhuman-core/src/modules/mod.rs
index 88dc3ebe00..bbac80e115 100644
--- a/crates/openhuman-core/src/modules/mod.rs
+++ b/crates/openhuman-core/src/modules/mod.rs
@@ -170,7 +170,10 @@ pub use types::{LoadPolicy, ModuleRecord, ModuleSource, ModuleState, ModuleStatu
/// Imports tinymcp's legacy SQLite files under `data_dir` into the module's
/// storage, once per directory. Never fails the caller: an error is logged and
/// the import is retried at the next open.
-pub async fn import_legacy_mcp(ctx: &crate::core::runtime::DispatchCtx, data_dir: &std::path::Path) {
+pub async fn import_legacy_mcp(
+ ctx: &crate::core::runtime::DispatchCtx,
+ data_dir: &std::path::Path,
+) {
#[cfg(feature = "modules")]
match storage_import_tinymcp::import_legacy(ctx, data_dir).await {
Ok(outcome) => log::debug!("[mcp] legacy storage import: {outcome:?}"),