Skip to content

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

refactor(tokenjuice): source recovery tool names from tinyjuice

Steven Enamakele808d7165f4d
diff --git a/crates/openhuman-core/src/agent/subagent_host/tool_prep_recovery_visibility_tests_tests.rs b/crates/openhuman-core/src/agent/subagent_host/tool_prep_recovery_visibility_tests_tests.rs
index 0e36a4ceaa..21af107a4d 100644
--- a/crates/openhuman-core/src/agent/subagent_host/tool_prep_recovery_visibility_tests_tests.rs
+++ b/crates/openhuman-core/src/agent/subagent_host/tool_prep_recovery_visibility_tests_tests.rs
@@ -1,5 +1,5 @@
use super::*;
-use crate::inference::tokenjuice::LEGACY_RETRIEVE_TOOL_NAME as RECOVERY_TOOL_NAME;
+const RECOVERY_TOOL_NAME: &str = "retrieve_tool_output";
use crate::tools::retrieve_tool_output_tool;
use tinyagents_harness_tools::CurrentTimeTool;
diff --git a/crates/openhuman-core/src/inference/tokenjuice/README.md b/crates/openhuman-core/src/inference/tokenjuice/README.md
index 9cad1dc027..e0cdb04b6e 100644
--- a/crates/openhuman-core/src/inference/tokenjuice/README.md
+++ b/crates/openhuman-core/src/inference/tokenjuice/README.md
@@ -58,12 +58,14 @@ behavior. There is no linked implementation fallback.
Builds without `modules` return an unavailable error.
- Controllers are registered from `crate::inference::tokenjuice::all_tokenjuice_registered_controllers()`,
called by [`core/all.rs`](../../core/all.rs).
-- `tools/ops.rs` registers `crate::inference::tokenjuice::TokenjuiceRetrieveTool::new()`
- in the agent tool catalog (it is not re-exported through [`tools/mod.rs`](../../tools/mod.rs)) and
+- `tools/ops.rs` constructs TinyJuice's
+ `tinyjuice_host::retrieve_tool::RetrieveToolOutputTool` with the host's
+ module-CCR lookup callback in the agent tool catalog (it is not re-exported
+ through [`tools/mod.rs`](../../tools/mod.rs)) and
treats every `RECOVERY_TOOL_NAMES` entry as a recovery tool. The registered
tool name is `tinyjuice_bus::tools::RETRIEVE` (`"juice_retrieve"`);
- `"tokenjuice_retrieve"` and `LEGACY_RETRIEVE_TOOL_NAME`
- (`"retrieve_tool_output"`) are recognized aliases only. Only
+ `"tokenjuice_retrieve"` and `"retrieve_tool_output"` are recognized aliases
+ only. Only
`RECOVERY_TOOL_VISIBLE` (the live tool) is force-added to a curated
`ToolScope::Named` belt (`session_host/builder/mod.rs::ensure_recovery_tool_visible`);
the aliases stay registered for transcript replay but off the wire. It is
diff --git a/crates/openhuman-core/src/inference/tokenjuice/mod_tests.rs b/crates/openhuman-core/src/inference/tokenjuice/mod_tests.rs
index 0e4c7d59c3..405d41d60f 100644
--- a/crates/openhuman-core/src/inference/tokenjuice/mod_tests.rs
+++ b/crates/openhuman-core/src/inference/tokenjuice/mod_tests.rs
@@ -4,7 +4,12 @@ use tinytools::Tool;
#[test]
fn host_tools_keep_the_published_recovery_names_and_schemas() {
- let retrieve = TokenjuiceRetrieveTool::new();
+ // Pin the actual tool the registry constructs before removing the local
+ // forwarding wrapper; this protects the model-facing contract byte for
+ // byte across the ownership move to tinyjuice-host.
+ let retrieve = tinyjuice_host::retrieve_tool::RetrieveToolOutputTool::new(
+ std::sync::Arc::new(|_, _| Box::pin(async { Ok(None) })),
+ );
assert_eq!(retrieve.name(), "juice_retrieve");
assert_eq!(
retrieve.permission_level(),
@@ -104,7 +109,8 @@ fn host_tools_keep_the_published_recovery_names_and_schemas() {
#[test]
fn recovery_tool_aliases_remain_stable() {
assert!(is_recovery_tool(tinyjuice_bus::tools::RETRIEVE));
- assert!(is_recovery_tool(LEGACY_RETRIEVE_TOOL_NAME));
+ assert!(is_recovery_tool(tinyjuice_bus::tools::LEGACY_RETRIEVE));
+ assert!(is_recovery_tool("retrieve_tool_output"));
assert!(!is_recovery_tool("shell"));
}