Skip to content

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

refactor(channels): remove conversation_histories from test contexts

Steven Enamakelda2377169599
diff --git a/crates/openhuman-core/src/channels/context_tests.rs b/crates/openhuman-core/src/channels/context_tests.rs
index e59cf3f843..ef7ad52ffb 100644
--- a/crates/openhuman-core/src/channels/context_tests.rs
+++ b/crates/openhuman-core/src/channels/context_tests.rs
@@ -40,7 +40,6 @@ fn runtime_context() -> ChannelRuntimeContext {
model: Arc::new("model".into()),
temperature: 0.0,
max_tool_iterations: 1,
- conversation_histories: Arc::new(Mutex::new(HashMap::new())),
turn_model_source_cache: Arc::new(Mutex::new(HashMap::new())),
route_overrides: Arc::new(Mutex::new(HashMap::new())),
api_url: None,
diff --git a/crates/openhuman-core/src/channels/routes_tests.rs b/crates/openhuman-core/src/channels/routes_tests.rs
index 0626696e17..03de3d5020 100644
--- a/crates/openhuman-core/src/channels/routes_tests.rs
+++ b/crates/openhuman-core/src/channels/routes_tests.rs
@@ -74,7 +74,6 @@ pub(super) fn runtime_context(workspace_dir: PathBuf) -> ChannelRuntimeContext {
model: Arc::new("reasoning-v1".into()),
temperature: 0.0,
max_tool_iterations: 1,
- conversation_histories: Arc::new(Mutex::new(HashMap::new())),
turn_model_source_cache: TurnModelSourceCacheMap::default(),
route_overrides: RouteSelectionMap::default(),
api_url: None,
diff --git a/crates/openhuman-core/src/channels/runtime/dispatch/host_agent/dispatch_tests.rs b/crates/openhuman-core/src/channels/runtime/dispatch/host_agent/dispatch_tests.rs
index aedda9372f..ec06d78ff8 100644
--- a/crates/openhuman-core/src/channels/runtime/dispatch/host_agent/dispatch_tests.rs
+++ b/crates/openhuman-core/src/channels/runtime/dispatch/host_agent/dispatch_tests.rs
@@ -53,7 +53,6 @@ fn context(channel: Arc<Telegram>, config: Config) -> Arc<ChannelRuntimeContext>
model: Arc::new("test-model".to_string()),
temperature: 0.0,
max_tool_iterations: 5,
- conversation_histories: Arc::new(Mutex::new(HashMap::new())),
turn_model_source_cache: Arc::new(Mutex::new(HashMap::new())),
route_overrides: Arc::new(Mutex::new(HashMap::new())),
api_url: None,
diff --git a/crates/openhuman-core/src/channels/runtime/startup/callback_tests.rs b/crates/openhuman-core/src/channels/runtime/startup/callback_tests.rs
index 2468e6e44d..2613426d6f 100644
--- a/crates/openhuman-core/src/channels/runtime/startup/callback_tests.rs
+++ b/crates/openhuman-core/src/channels/runtime/startup/callback_tests.rs
@@ -160,7 +160,6 @@ fn callback_for_channels(
model: Arc::new("test-model".into()),
temperature: 0.0,
max_tool_iterations: 1,
- conversation_histories: Arc::new(Mutex::new(HashMap::new())),
turn_model_source_cache: Arc::new(Mutex::new(HashMap::new())),
route_overrides: Arc::new(Mutex::new(HashMap::new())),
api_url: None,
diff --git a/crates/openhuman-core/src/channels/runtime/startup/turn_parts.rs b/crates/openhuman-core/src/channels/runtime/startup/turn_parts.rs
index 84b67eaa54..640d76af9a 100644
--- a/crates/openhuman-core/src/channels/runtime/startup/turn_parts.rs
+++ b/crates/openhuman-core/src/channels/runtime/startup/turn_parts.rs
@@ -251,8 +251,6 @@ pub(crate) fn runtime_context(
model: Arc::new(parts.model),
temperature: config.default_temperature,
max_tool_iterations: config.agent.max_tool_iterations,
- #[cfg(test)]
- conversation_histories: Arc::new(Mutex::new(HashMap::new())),
turn_model_source_cache: Arc::new(Mutex::new(HashMap::new())),
route_overrides: Arc::new(Mutex::new(HashMap::new())),
api_url: config.api_url.clone(),
diff --git a/crates/openhuman-core/src/channels/runtime/test_support.rs b/crates/openhuman-core/src/channels/runtime/test_support.rs
index 01497b64cb..7d3d2fa8f2 100644
--- a/crates/openhuman-core/src/channels/runtime/test_support.rs
+++ b/crates/openhuman-core/src/channels/runtime/test_support.rs
@@ -421,7 +421,6 @@ pub async fn run_dispatch_harness(options: DispatchHarnessOptions) -> DispatchHa
model: Arc::new("harness-model".to_string()),
temperature: 0.0,
max_tool_iterations: 3,
- conversation_histories: Arc::clone(&conversation_histories),
turn_model_source_cache: Arc::new(Mutex::new(provider_cache)),
route_overrides: Arc::new(Mutex::new(HashMap::new())),
api_url: None,
diff --git a/crates/openhuman-core/src/channels/tests/discord_integration.rs b/crates/openhuman-core/src/channels/tests/discord_integration.rs
index 53714bd215..d3cb5844a7 100644
--- a/crates/openhuman-core/src/channels/tests/discord_integration.rs
+++ b/crates/openhuman-core/src/channels/tests/discord_integration.rs
@@ -115,7 +115,6 @@ fn make_discord_ctx(
model: Arc::new("test-model".to_string()),
temperature: 0.0,
max_tool_iterations: 1,
- conversation_histories: Arc::new(Mutex::new(HashMap::new())),
turn_model_source_cache: Arc::new(Mutex::new(HashMap::new())),
route_overrides: Arc::new(Mutex::new(HashMap::new())),
api_url: None,
diff --git a/crates/openhuman-core/src/channels/tests/runtime_dispatch.rs b/crates/openhuman-core/src/channels/tests/runtime_dispatch.rs
index e3c5a413bd..3b7cd02a09 100644
--- a/crates/openhuman-core/src/channels/tests/runtime_dispatch.rs
+++ b/crates/openhuman-core/src/channels/tests/runtime_dispatch.rs
@@ -131,8 +131,7 @@ async fn message_dispatch_processes_messages_in_parallel() {
model: Arc::new("test-model".to_string()),
temperature: 0.0,
max_tool_iterations: 10,
- conversation_histories: Arc::new(Mutex::new(HashMap::new())),
- turn_model_source_cache: Arc::new(Mutex::new(HashMap::new())),
+ turn_model_source_cache: Arc::new(Mutex::new(HashMap::new())),
route_overrides: Arc::new(Mutex::new(HashMap::new())),
api_url: None,
inference_url: None,
@@ -212,7 +211,6 @@ async fn process_channel_message_cancels_scoped_typing_task() {
model: Arc::new("test-model".to_string()),
temperature: 0.0,
max_tool_iterations: 10,
- conversation_histories: Arc::new(Mutex::new(HashMap::new())),
turn_model_source_cache: Arc::new(Mutex::new(HashMap::new())),
route_overrides: Arc::new(Mutex::new(HashMap::new())),
api_url: None,
@@ -305,7 +303,6 @@ async fn dispatch_routes_through_agent_run_turn_bus_handler() {
model: Arc::new("test-model".to_string()),
temperature: 0.0,
max_tool_iterations: 10,
- conversation_histories: Arc::new(Mutex::new(HashMap::new())),
turn_model_source_cache: Arc::new(Mutex::new(HashMap::new())),
route_overrides: Arc::new(Mutex::new(HashMap::new())),
api_url: None,
@@ -429,7 +426,6 @@ async fn resolved_route_ctx() -> Arc<ChannelRuntimeContext> {
model: Arc::new("requested-model".to_string()),
temperature: 0.0,
max_tool_iterations: 10,
- conversation_histories: Arc::new(Mutex::new(HashMap::new())),
turn_model_source_cache: Arc::new(Mutex::new(HashMap::new())),
route_overrides: Arc::new(Mutex::new(HashMap::new())),
api_url: None,
@@ -566,7 +562,6 @@ async fn process_channel_message_hardens_multimodal_files_against_smuggled_marke
model: Arc::new("test-model".to_string()),
temperature: 0.0,
max_tool_iterations: 10,
- conversation_histories: Arc::new(Mutex::new(HashMap::new())),
turn_model_source_cache: Arc::new(Mutex::new(HashMap::new())),
route_overrides: Arc::new(Mutex::new(HashMap::new())),
api_url: None,
@@ -654,7 +649,6 @@ async fn process_channel_message_hardens_against_relative_path_markers() {
model: Arc::new("test-model".to_string()),
temperature: 0.0,
max_tool_iterations: 10,
- conversation_histories: Arc::new(Mutex::new(HashMap::new())),
turn_model_source_cache: Arc::new(Mutex::new(HashMap::new())),
route_overrides: Arc::new(Mutex::new(HashMap::new())),
api_url: None,
diff --git a/crates/openhuman-core/src/channels/tests/runtime_tool_calls.rs b/crates/openhuman-core/src/channels/tests/runtime_tool_calls.rs
index 73f44e171c..c18dc08d9a 100644
--- a/crates/openhuman-core/src/channels/tests/runtime_tool_calls.rs
+++ b/crates/openhuman-core/src/channels/tests/runtime_tool_calls.rs
@@ -37,7 +37,6 @@ async fn process_channel_message_executes_native_tool_calls() {
model: Arc::new("test-model".to_string()),
temperature: 0.0,
max_tool_iterations: 10,
- conversation_histories: Arc::new(Mutex::new(HashMap::new())),
turn_model_source_cache: Arc::new(Mutex::new(HashMap::new())),
route_overrides: Arc::new(Mutex::new(HashMap::new())),
api_url: None,
@@ -113,7 +112,6 @@ async fn process_channel_message_handles_models_command_without_llm_call() {
model: Arc::new("default-model".to_string()),
temperature: 0.0,
max_tool_iterations: 5,
- conversation_histories: Arc::new(Mutex::new(HashMap::new())),
turn_model_source_cache: Arc::new(Mutex::new(provider_cache_seed)),
route_overrides: Arc::new(Mutex::new(HashMap::new())),
api_url: None,
@@ -220,7 +218,6 @@ async fn process_channel_message_uses_route_override_provider_and_model() {
model: Arc::new("default-model".to_string()),
temperature: 0.0,
max_tool_iterations: 5,
- conversation_histories: Arc::new(Mutex::new(HashMap::new())),
turn_model_source_cache: Arc::new(Mutex::new(provider_cache_seed)),
route_overrides: Arc::new(Mutex::new(route_overrides)),
api_url: None,
@@ -273,7 +270,6 @@ async fn process_channel_message_respects_configured_max_tool_iterations_above_d
model: Arc::new("test-model".to_string()),
temperature: 0.0,
max_tool_iterations: 12,
- conversation_histories: Arc::new(Mutex::new(HashMap::new())),
turn_model_source_cache: Arc::new(Mutex::new(HashMap::new())),
route_overrides: Arc::new(Mutex::new(HashMap::new())),
api_url: None,
@@ -336,7 +332,6 @@ async fn process_channel_message_reports_configured_max_tool_iterations_limit()
model: Arc::new("test-model".to_string()),
temperature: 0.0,
max_tool_iterations: 3,
- conversation_histories: Arc::new(Mutex::new(HashMap::new())),
turn_model_source_cache: Arc::new(Mutex::new(HashMap::new())),
route_overrides: Arc::new(Mutex::new(HashMap::new())),
api_url: None,
diff --git a/crates/openhuman-core/src/channels/tests/telegram_integration.rs b/crates/openhuman-core/src/channels/tests/telegram_integration.rs
index d52f498a98..db91b7696d 100644
--- a/crates/openhuman-core/src/channels/tests/telegram_integration.rs
+++ b/crates/openhuman-core/src/channels/tests/telegram_integration.rs
@@ -91,7 +91,6 @@ fn make_test_context(
model: Arc::new("test-model".to_string()),
temperature: 0.0,
max_tool_iterations: 1,
- conversation_histories: Arc::new(Mutex::new(HashMap::new())),
turn_model_source_cache: Arc::new(Mutex::new(HashMap::new())),
route_overrides: Arc::new(Mutex::new(HashMap::new())),
api_url: None,