Skip to content

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

fix(agent): handle missing todo tool in subagent transcript view

Steven Enamakel2dc30e90c638
diff --git a/crates/openhuman-core/src/agent/tools/todo.rs b/crates/openhuman-core/src/agent/tools/todo.rs
index 40496eabf2..c8f453c8c3 100644
--- a/crates/openhuman-core/src/agent/tools/todo.rs
+++ b/crates/openhuman-core/src/agent/tools/todo.rs
@@ -57,7 +57,14 @@ impl ToolDispatch<(), crate::agent::tinyagents::host::OpenHumanRunContext> for T
parent: &RunContext<crate::agent::tinyagents::host::OpenHumanRunContext>,
) -> anyhow::Result<ToolResult> {
let context = ToolExecutionContext::from_run_context(parent, call_id);
- TodoTool::new()
+ let workspace_dir = match parent.data.parent.as_ref() {
+ Some(parent_ctx) => parent_ctx.workspace_dir.clone(),
+ None => crate::config::Config::load_or_init()
+ .await
+ .map(|c| c.workspace_dir)
+ .map_err(|e| anyhow::anyhow!("[tool][todo] load config: {e}"))?,
+ };
+ TodoTool::new(workspace_dir)
.execute_with_parent_context(arguments, parent.data.parent.clone(), Some(&context))
.await
}
diff --git a/crates/openhuman-core/src/threads/transcript_view/subagents.rs b/crates/openhuman-core/src/threads/transcript_view/subagents.rs
index 1efa29f6c1..c34037479c 100644
--- a/crates/openhuman-core/src/threads/transcript_view/subagents.rs
+++ b/crates/openhuman-core/src/threads/transcript_view/subagents.rs
@@ -68,7 +68,7 @@ pub(super) fn attach(
segments: &[(String, i64)],
workspace_dir: Option<&Path>,
) {
- let children = build_children(sub_paths, None, 0);
+ let children = build_children(sub_paths, None, 0, workspace_dir);
place(items, children, segments, workspace_dir);
}