Skip to content

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

test(agent): set model name in session host test builders

Steven Enamakel8c7274918b86
diff --git a/crates/openhuman-core/src/agent/session_host/imported_history_tests.rs b/crates/openhuman-core/src/agent/session_host/imported_history_tests.rs
index 6adf498697..e50bd33115 100644
--- a/crates/openhuman-core/src/agent/session_host/imported_history_tests.rs
+++ b/crates/openhuman-core/src/agent/session_host/imported_history_tests.rs
@@ -42,6 +42,7 @@ async fn run_imported_history_prefix_regression() {
let mut first = SessionHostBuilder::new()
.with_session_history_locator(Arc::clone(&locator))
.chat_model(first_chat_model)
+ .model_name("test-model")
.tools(vec![tool()])
.prompt_builder(crate::agent::prompts::SystemPromptBuilder::verbatim(
"You are the relay assistant. Preserve this exact system prefix.".to_owned(),
@@ -142,6 +143,7 @@ async fn run_imported_history_prefix_regression() {
let mut second = SessionHostBuilder::new()
.with_session_history_locator(locator)
.chat_model(second_chat_model)
+ .model_name("test-model")
.tools(vec![tool()])
.prompt_builder(crate::agent::prompts::SystemPromptBuilder::verbatim(
"This replacement prompt must not change an existing session.".to_owned(),
@@ -205,6 +207,7 @@ async fn legacy_history_is_loaded_only_for_an_unwritten_bound_session() {
let mut host = SessionHostBuilder::new()
.with_session_history_locator(Arc::clone(&locator))
.chat_model(chat_model)
+ .model_name("test-model")
.tools(vec![tool()])
.workspace_dir(root.path().join("workspace"))
.action_dir(root.path().to_path_buf())
@@ -305,6 +308,7 @@ async fn legacy_history_is_loaded_only_for_an_unwritten_bound_session() {
let mut resumed = SessionHostBuilder::new()
.with_session_history_locator(locator.clone())
.chat_model(second_chat_model)
+ .model_name("test-model")
.tools(vec![tool()])
.workspace_dir(second_root.path().join("workspace"))
.action_dir(second_root.path().to_path_buf())
diff --git a/crates/openhuman-core/src/agent/turn_host_tests.rs b/crates/openhuman-core/src/agent/turn_host_tests.rs
index 98ab43eb93..51770c78b7 100644
--- a/crates/openhuman-core/src/agent/turn_host_tests.rs
+++ b/crates/openhuman-core/src/agent/turn_host_tests.rs
@@ -34,6 +34,7 @@ fn session_with_workspace(path: &str) -> OpenHumanSessionHost {
let chat_model: std::sync::Arc<dyn tinyinference_llm::model::ChatModel<()>> = model;
crate::agent::SessionHostBuilder::new()
.chat_model(chat_model)
+ .model_name("test-model")
.tools(Vec::new())
.workspace_dir(root.path().join("workspace"))
.action_dir(root.path().to_path_buf())