Skip to content

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

fix(harness_assembly): correct agent harness assembly to use the right builder method

Steven Enamakel09146a1a2aa1
diff --git a/crates/openhuman-core/src/agent/tinyagents/harness_assembly.rs b/crates/openhuman-core/src/agent/tinyagents/harness_assembly.rs
index 4ec112a2af..658c470a4d 100644
--- a/crates/openhuman-core/src/agent/tinyagents/harness_assembly.rs
+++ b/crates/openhuman-core/src/agent/tinyagents/harness_assembly.rs
@@ -135,6 +135,13 @@ pub(super) fn assemble_turn_harness(
// The dialect the session composed its prompt for; see
// `OpenHumanRunContext::tool_dialect`.
tool_dialect: tinyagents_harness::config::ToolDispatcher,
+ // Live per-thread Plan/Build mode handle (`agent::tinyagents::run_mode`).
+ // `Some` installs `PlanModeMiddleware`, which hides/denies side-effecting
+ // tools while the thread is in `RunMode::Plan` — flipped without
+ // restarting the run by `plan_exit` or the `agent.set_run_mode` RPC.
+ // `None` for a caller with no thread identity (a sub-agent child, most
+ // notably), which never runs in plan mode.
+ run_mode: Option<RunModeHandle>,
) -> AssembledTurnHarness {
let mut harness: AgentHarness<(), OpenHumanRunContext> = AgentHarness::new();
// Cross-route fallback ownership (issue #4249, Workstream 02.2): populate the