Skip to content

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

feat(tokenjuice): add repl handle and save configuration options

Steven Enamakel6a4150eccafe
diff --git a/app/src/utils/tauriCommands/tokenjuice.ts b/app/src/utils/tauriCommands/tokenjuice.ts
index b93140bd6e..8a1c180da1 100644
--- a/app/src/utils/tauriCommands/tokenjuice.ts
+++ b/app/src/utils/tauriCommands/tokenjuice.ts
@@ -11,6 +11,10 @@ import { callCoreRpc } from '../../services/coreRpcClient';
export interface TokenjuiceSettings {
router_enabled: boolean;
ccr_enabled: boolean;
+ /** Store large results behind a handle queried with juice_find/extract/summarize. */
+ repl_handle_enabled?: boolean;
+ /** Also write a plain-text copy of each stored original under the workspace. */
+ repl_save_enabled?: boolean;
ccr_disk_enabled: boolean;
max_cache_entries: number;
max_cache_bytes: number;
diff --git a/crates/openhuman-core/src/config/schema/load/env_overlay/dictation_context.rs b/crates/openhuman-core/src/config/schema/load/env_overlay/dictation_context.rs
index f21568a8c5..587e4d992b 100644
--- a/crates/openhuman-core/src/config/schema/load/env_overlay/dictation_context.rs
+++ b/crates/openhuman-core/src/config/schema/load/env_overlay/dictation_context.rs
@@ -89,8 +89,8 @@ impl Config {
self.context.tool_result_budget_bytes = n;
}
}
- // Switch for native tool-output compaction (Stage 1a). Off by
- // default; `OPENHUMAN_COMPACTION=1` turns it on for an A/B bisect.
+ // Switch for native tool-output compaction (Stage 1a). On by
+ // default; `OPENHUMAN_COMPACTION=0` opts out (and is the A/B bisect).
// Accepts the canonical short name and the namespaced form.
if let Some(flag) = env
.get("OPENHUMAN_COMPACTION")
diff --git a/crates/openhuman-core/src/config/schema/load/env_overlay/runtime.rs b/crates/openhuman-core/src/config/schema/load/env_overlay/runtime.rs
index 06c24a510d..a357d82c07 100644
--- a/crates/openhuman-core/src/config/schema/load/env_overlay/runtime.rs
+++ b/crates/openhuman-core/src/config/schema/load/env_overlay/runtime.rs
@@ -129,6 +129,16 @@ impl Config {
self.tokenjuice.ccr_enabled = v;
}
}
+ if let Some(flag) = env.get("OPENHUMAN_TOKENJUICE_REPL_HANDLE_ENABLED") {
+ if let Some(v) = parse_env_bool("OPENHUMAN_TOKENJUICE_REPL_HANDLE_ENABLED", &flag) {
+ self.tokenjuice.repl_handle_enabled = v;
+ }
+ }
+ if let Some(flag) = env.get("OPENHUMAN_TOKENJUICE_REPL_SAVE_ENABLED") {
+ if let Some(v) = parse_env_bool("OPENHUMAN_TOKENJUICE_REPL_SAVE_ENABLED", &flag) {
+ self.tokenjuice.repl_save_enabled = v;
+ }
+ }
if let Some(flag) = env.get("OPENHUMAN_TOKENJUICE_CCR_DISK_ENABLED") {
if let Some(v) = parse_env_bool("OPENHUMAN_TOKENJUICE_CCR_DISK_ENABLED", &flag) {
self.tokenjuice.ccr_disk_enabled = v;
diff --git a/crates/openhuman-core/src/inference/tokenjuice/config_patch.rs b/crates/openhuman-core/src/inference/tokenjuice/config_patch.rs
index 8dad19a560..b4eab9667d 100644
--- a/crates/openhuman-core/src/inference/tokenjuice/config_patch.rs
+++ b/crates/openhuman-core/src/inference/tokenjuice/config_patch.rs
@@ -13,6 +13,8 @@ use crate::config::TokenjuiceConfig;
pub struct TokenjuiceSettingsPatch {
pub router_enabled: Option<bool>,
pub ccr_enabled: Option<bool>,
+ pub repl_handle_enabled: Option<bool>,
+ pub repl_save_enabled: Option<bool>,
pub ccr_disk_enabled: Option<bool>,
pub max_cache_entries: Option<usize>,
pub max_cache_bytes: Option<usize>,
@@ -40,6 +42,12 @@ impl TokenjuiceSettingsPatch {
if let Some(v) = self.ccr_enabled {
cfg.ccr_enabled = v;
}
+ if let Some(v) = self.repl_handle_enabled {
+ cfg.repl_handle_enabled = v;
+ }
+ if let Some(v) = self.repl_save_enabled {
+ cfg.repl_save_enabled = v;
+ }
if let Some(v) = self.ccr_disk_enabled {
cfg.ccr_disk_enabled = v;
}