Skip to content

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

refactor(agent): construct plan_exit tool per call instead of caching it

Steven Enamakel8094dce4c3d7
diff --git a/crates/openhuman-core/src/agent/tools/plan_exit.rs b/crates/openhuman-core/src/agent/tools/plan_exit.rs
index a060746e63..0238930736 100644
--- a/crates/openhuman-core/src/agent/tools/plan_exit.rs
+++ b/crates/openhuman-core/src/agent/tools/plan_exit.rs
@@ -1,6 +1,6 @@
//! OpenHuman's tenant-aware adapter for the harness-owned `plan_exit` tool.
-use std::sync::{Arc, OnceLock};
+use std::sync::Arc;
use async_trait::async_trait;
use serde_json::Value;
@@ -25,12 +25,8 @@ fn mode_lookup(context: &dyn ToolRunContext) -> Option<RunModeHandle> {
))
}
-static OWNER_TOOL: OnceLock<tinyagents_harness::tool::plan_exit::PlanExitTool> = OnceLock::new();
-
-fn owner_tool() -> &'static tinyagents_harness::tool::plan_exit::PlanExitTool {
- OWNER_TOOL.get_or_init(|| {
- tinyagents_harness::tool::plan_exit::PlanExitTool::new(Arc::new(mode_lookup))
- })
+fn owner_tool() -> tinyagents_harness::tool::plan_exit::PlanExitTool {
+ tinyagents_harness::tool::plan_exit::PlanExitTool::new(Arc::new(mode_lookup))
}
/// Public unit-shaped compatibility adapter around TinyAgents' tool engine.