Skip to content

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

test(agent_cli): make prompt size test self-contained

Steven Enamakel083296f8d9e6
diff --git a/crates/openhuman-core/src/core/agent_cli/debug/prompt_size_tests.rs b/crates/openhuman-core/src/core/agent_cli/debug/prompt_size_tests.rs
index 993eef487a..fb14de438e 100644
--- a/crates/openhuman-core/src/core/agent_cli/debug/prompt_size_tests.rs
+++ b/crates/openhuman-core/src/core/agent_cli/debug/prompt_size_tests.rs
@@ -84,9 +84,15 @@ fn session_report_measures_the_visible_belt_not_the_registry() {
workspace_dir: tmp.path().join("workspace"),
action_dir: tmp.path().join("workspace"),
config_path: tmp.path().join("config.toml"),
+ // The session model is the in-process fixture, so building it needs no
+ // backend session; a standing API key satisfies the session gate.
+ default_model: Some("test/session-fixture".to_string()),
..crate::config::Config::default()
};
std::fs::create_dir_all(&config.workspace_dir).unwrap();
+ crate::agent::session_host::test_support::install_model_fixture();
+ crate::security::credentials::api_key::store_api_key(&config, "test-prompt-size-key")
+ .expect("test api key");
let mut definition =
crate::agent_registry::host_definition::AgentDefinitionRegistry::builtins_only()
.get("orchestrator")
@@ -99,7 +105,7 @@ fn session_report_measures_the_visible_belt_not_the_registry() {
&config,
&definition,
)
- .unwrap_or_else(|e| { eprintln!("DBG build: {e:#}"); panic!("x") });
+ .expect("test-owned prompt-size session build");
let dumped =
crate::core::agent_cli::debug::session_dump(&agent, "prompt_size_probe", String::new());