fix(agent): tune tokenjuice compression per agent (#4139)

This commit is contained in:
Steven Enamakel's Droid
2026-06-26 00:19:45 -07:00
committed by GitHub
parent 2652db773e
commit ebba7b699c
35 changed files with 274 additions and 20 deletions
@@ -20,6 +20,7 @@ use openhuman_core::openhuman::memory::{
Memory, MemoryCategory, MemoryEntry, NamespaceSummary, RecallOpts,
};
use openhuman_core::openhuman::memory_store::{events, fts5, profile, segments};
use openhuman_core::openhuman::tokenjuice::AgentTokenjuiceCompression;
use openhuman_core::openhuman::tools::{PermissionLevel, Tool, ToolResult};
use parking_lot::Mutex;
use rusqlite::Connection;
@@ -255,6 +256,7 @@ fn definition(max_iterations: usize) -> AgentDefinition {
timeout_secs: None,
sandbox_mode: SandboxMode::None,
background: false,
tokenjuice_compression: AgentTokenjuiceCompression::Auto,
subagents: Vec::new(),
delegate_name: None,
agent_tier: Default::default(),
@@ -21,6 +21,7 @@ use openhuman_core::openhuman::inference::provider::{
use openhuman_core::openhuman::memory::{
Memory, MemoryCategory, MemoryEntry, NamespaceSummary as MemoryNamespaceSummary, RecallOpts,
};
use openhuman_core::openhuman::tokenjuice::AgentTokenjuiceCompression;
use openhuman_core::openhuman::tools::{PermissionLevel, Tool, ToolContent, ToolResult};
use parking_lot::Mutex;
use serde_json::json;
@@ -363,6 +364,7 @@ fn definition(max_result_chars: Option<usize>) -> AgentDefinition {
sandbox_mode: SandboxMode::None,
background: false,
trigger_memory_agent: Default::default(),
tokenjuice_compression: AgentTokenjuiceCompression::Auto,
subagents: Vec::new(),
delegate_name: None,
agent_tier: AgentTier::Worker,
+2
View File
@@ -15,6 +15,7 @@ use openhuman_core::openhuman::inference::provider::{
ChatMessage, ChatRequest, ChatResponse, Provider, ToolCall, UsageInfo,
};
use openhuman_core::openhuman::memory::{Memory, MemoryCategory, MemoryEntry, NamespaceSummary};
use openhuman_core::openhuman::tokenjuice::AgentTokenjuiceCompression;
use openhuman_core::openhuman::tools::SpawnSubagentTool;
use openhuman_core::openhuman::tools::{Tool, ToolResult};
use parking_lot::Mutex;
@@ -321,6 +322,7 @@ fn coverage_definition() -> AgentDefinition {
sandbox_mode: SandboxMode::ReadOnly,
background: false,
trigger_memory_agent: Default::default(),
tokenjuice_compression: AgentTokenjuiceCompression::Auto,
subagents: Vec::new(),
delegate_name: None,
agent_tier: Default::default(),
@@ -15,6 +15,7 @@ use openhuman_core::openhuman::inference::provider::{
use openhuman_core::openhuman::memory::{
Memory, MemoryCategory, MemoryEntry, NamespaceSummary, RecallOpts,
};
use openhuman_core::openhuman::tokenjuice::AgentTokenjuiceCompression;
use openhuman_core::openhuman::tools::{PermissionLevel, Tool, ToolResult};
use parking_lot::Mutex;
use serde_json::json;
@@ -295,6 +296,7 @@ fn integrations_definition() -> AgentDefinition {
sandbox_mode: SandboxMode::None,
background: false,
trigger_memory_agent: Default::default(),
tokenjuice_compression: AgentTokenjuiceCompression::Auto,
subagents: Vec::new(),
delegate_name: None,
agent_tier: Default::default(),
@@ -21,6 +21,7 @@ use openhuman_core::openhuman::inference::provider::{
use openhuman_core::openhuman::memory::{
Memory, MemoryCategory, MemoryEntry, NamespaceSummary as MemoryNamespaceSummary, RecallOpts,
};
use openhuman_core::openhuman::tokenjuice::AgentTokenjuiceCompression;
use openhuman_core::openhuman::tools::{PermissionLevel, Tool, ToolResult};
use parking_lot::Mutex;
use serde_json::json;
@@ -261,6 +262,7 @@ fn definition(prompt: PromptSource) -> AgentDefinition {
sandbox_mode: SandboxMode::None,
background: false,
trigger_memory_agent: Default::default(),
tokenjuice_compression: AgentTokenjuiceCompression::Auto,
subagents: Vec::new(),
delegate_name: None,
agent_tier: Default::default(),
@@ -22,6 +22,7 @@ use openhuman_core::openhuman::memory::{
Memory, MemoryCategory, MemoryEntry, NamespaceSummary, RecallOpts,
};
use openhuman_core::openhuman::memory_store;
use openhuman_core::openhuman::tokenjuice::AgentTokenjuiceCompression;
use openhuman_core::openhuman::tools::traits::ToolCallOptions;
use openhuman_core::openhuman::tools::{
PermissionLevel, Tool, ToolContent, ToolResult, ToolScope as RuntimeToolScope,
@@ -1020,6 +1021,7 @@ fn definition(
sandbox_mode: SandboxMode::None,
background: false,
trigger_memory_agent: Default::default(),
tokenjuice_compression: AgentTokenjuiceCompression::Auto,
subagents: Vec::new(),
delegate_name: None,
agent_tier: AgentTier::Worker,
@@ -181,6 +181,7 @@ use openhuman_core::openhuman::profiles::{
};
use openhuman_core::openhuman::security::SecurityPolicy;
use openhuman_core::openhuman::todos::ops::BoardLocation;
use openhuman_core::openhuman::tokenjuice::AgentTokenjuiceCompression;
use openhuman_core::openhuman::tools::{Tool, ToolResult, ToolSpec};
static ENV_LOCK: Mutex<()> = Mutex::new(());
@@ -1602,6 +1603,7 @@ named = ["todo", "plan_exit"]
sandbox_mode: SandboxMode::None,
background: false,
trigger_memory_agent: Default::default(),
tokenjuice_compression: AgentTokenjuiceCompression::Auto,
subagents: Vec::new(),
delegate_name: None,
agent_tier: AgentTier::Worker,
@@ -42,6 +42,7 @@ use openhuman_core::openhuman::inference::provider::{
};
use openhuman_core::openhuman::memory::{Memory, MemoryCategory, MemoryEntry, NamespaceSummary};
use openhuman_core::openhuman::security::{AuditLogger, SecurityPolicy};
use openhuman_core::openhuman::tokenjuice::AgentTokenjuiceCompression;
use openhuman_core::openhuman::tools::{
all_tools, BrowserTool, ComputerUseConfig, SpawnSubagentTool, Tool, ToolResult,
};
@@ -408,6 +409,7 @@ fn agent_definition(id: &str, max_result_chars: Option<usize>) -> AgentDefinitio
sandbox_mode: SandboxMode::ReadOnly,
background: false,
trigger_memory_agent: Default::default(),
tokenjuice_compression: AgentTokenjuiceCompression::Auto,
subagents: Vec::new(),
delegate_name: None,
agent_tier: Default::default(),
@@ -85,6 +85,7 @@ use openhuman_core::openhuman::memory::{
Memory, MemoryCategory, MemoryEntry, NamespaceSummary, RecallOpts,
};
use openhuman_core::openhuman::security::{AuditLogger, AutonomyLevel, SecurityPolicy};
use openhuman_core::openhuman::tokenjuice::AgentTokenjuiceCompression;
use openhuman_core::openhuman::tool_registry::ops::diagnostics_for_config;
use openhuman_core::openhuman::tool_registry::{
all_tool_registry_controller_schemas, all_tool_registry_registered_controllers,
@@ -301,6 +302,7 @@ fn coverage_agent_definition(
sandbox_mode: SandboxMode::None,
background: false,
trigger_memory_agent: Default::default(),
tokenjuice_compression: AgentTokenjuiceCompression::Auto,
subagents: vec![],
delegate_name: delegate_name.map(str::to_string),
agent_tier: AgentTier::Worker,