Skip to content

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

fix(caps_host): carry flow caller owner into harness host env

Steven Enamakel509d6a81bb3e
diff --git a/crates/openhuman-core/src/flows/caps_host/agent_harness.rs b/crates/openhuman-core/src/flows/caps_host/agent_harness.rs
index 8039428439..8b39abbf92 100644
--- a/crates/openhuman-core/src/flows/caps_host/agent_harness.rs
+++ b/crates/openhuman-core/src/flows/caps_host/agent_harness.rs
@@ -124,6 +124,9 @@ impl OpenHumanAgentRunner {
let absolute_deadline =
tokio::time::Instant::from_std(deadline.started() + deadline.backstop());
let mut host_env = agent.host_env().clone();
+ // Harness turns can outlive the flow node's task-local scope when
+ // they spawn sub-agents. Carry the flow caller's owner explicitly.
+ host_env.core = self.ctx.downgrade();
host_env.turn_deadline = Some(deadline);
agent.set_host_env(host_env);