Skip to content

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

refactor(tokenjuice): add Default impl for retrieve tool

Steven Enamakelc53c95e5d51e
diff --git a/crates/openhuman-core/src/config/schema/tokenjuice_tests.rs b/crates/openhuman-core/src/config/schema/tokenjuice_tests.rs
index 6c40b33333..8fcf0a32d1 100644
--- a/crates/openhuman-core/src/config/schema/tokenjuice_tests.rs
+++ b/crates/openhuman-core/src/config/schema/tokenjuice_tests.rs
@@ -40,8 +40,5 @@ fn an_older_config_without_the_new_keys_gets_the_on_defaults() {
fn legacy_repl_save_setting_is_ignored() {
let c: TokenjuiceConfig = toml::from_str("repl_save_enabled = true").unwrap();
assert!(c.repl_handle_enabled);
- assert_eq!(
- toml::to_string(&c).unwrap().contains("repl_save_enabled"),
- false
- );
+ assert!(!toml::to_string(&c).unwrap().contains("repl_save_enabled"));
}
diff --git a/crates/openhuman-core/src/inference/tokenjuice/mod.rs b/crates/openhuman-core/src/inference/tokenjuice/mod.rs
index 48d13e87cc..74c99dc5ef 100644
--- a/crates/openhuman-core/src/inference/tokenjuice/mod.rs
+++ b/crates/openhuman-core/src/inference/tokenjuice/mod.rs
@@ -17,6 +17,12 @@ pub struct TokenjuiceRetrieveTool(tinyjuice_host::retrieve_tool::RetrieveToolOut
impl TokenjuiceRetrieveTool {
pub fn new() -> Self {
+ Self::default()
+ }
+}
+
+impl Default for TokenjuiceRetrieveTool {
+ fn default() -> Self {
Self(tinyjuice_host::retrieve_tool::RetrieveToolOutputTool::new(
std::sync::Arc::new(|token, range| {
Box::pin(async move { retrieve(token, range).await })