Skip to content

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

fix(agent): skip plan sequencing on a turn without the todo tool

M3gA-Minda4684ccf403b
diff --git a/crates/openhuman-core/src/agent/tinyagents/turn_exec.rs b/crates/openhuman-core/src/agent/tinyagents/turn_exec.rs
index 32c8d03d74..8fcec016da 100644
--- a/crates/openhuman-core/src/agent/tinyagents/turn_exec.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/turn_exec.rs
@@ -485,6 +485,13 @@ async fn drive_turn(
anyhow::anyhow!("turn driver prepared a run without a steering handle")
})?;
let tool_count = prepared.tools().registered.len();
+ // A turn without the `todo` tool (tools suppressed, or `todo` not admitted)
+ // cannot tick its plan, so it gets no plan-order middleware.
+ let todo_registered = prepared
+ .tools()
+ .registered
+ .iter()
+ .any(|name| name == "todo");
let candidate_names = prepared.tools().plan.candidates.clone();
let TurnWiring {
@@ -523,6 +530,7 @@ async fn drive_turn(
todo_store: run_context
.parent
.as_ref()
+ .filter(|_| todo_registered)
.map(|parent| crate::agent::todos::ops::store(&parent.workspace_dir)),
},
);
diff --git a/crates/openhuman-core/src/agent/tinyagents/turn_middleware.rs b/crates/openhuman-core/src/agent/tinyagents/turn_middleware.rs
index 9809c1e90f..19e23804dd 100644
--- a/crates/openhuman-core/src/agent/tinyagents/turn_middleware.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/turn_middleware.rs
@@ -90,7 +90,8 @@ pub(super) struct TurnMiddlewareInputs {
/// Per-call tool success/content capture for honest `ToolCallRecord`s.
pub(super) tool_outcome_sink: ToolOutcomeSink,
/// The store the `todo` tool writes this turn's plan to; `Some` lets the
- /// plan-order middleware read it. `None` for a turn with no workspace.
+ /// plan-order middleware read it. `None` for a turn with no workspace or
+ /// without the `todo` tool.
pub(super) todo_store: Option<Arc<dyn tinyagents_harness::store::Store>>,
}