The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
test(session_host): cover debug prompt matching cold-turn system prompt
Steven Enamakel2418ead200c7
diff --git a/crates/openhuman-core/src/agent/session_host/runtime_session_tests.rs b/crates/openhuman-core/src/agent/session_host/runtime_session_tests.rsindex f30ce5039e..07aec867f5 100644--- a/crates/openhuman-core/src/agent/session_host/runtime_session_tests.rs+++ b/crates/openhuman-core/src/agent/session_host/runtime_session_tests.rs@@ -583,14 +583,60 @@ async fn prompt_and_declared_tools(.prelude.clone().expect("prelude");- let tiered = prelude.build_system_prompt_tiered().expect("system prompt");+ let prompt = host+ .render_current_turn_prompt()+ .expect("current-turn system prompt");let snapshot = prelude.prepare(true).await.expect("tool surface").tools.expect("declared tools");- (tiered.text, snapshot)+ (prompt, snapshot)+}++#[tokio::test]+async fn debug_prompt_matches_the_system_prompt_sent_on_a_cold_turn() {+ let _ = crate::agent_registry::host_definition::AgentDefinitionRegistry::init_global_builtins();+ let action_dir = tempfile::tempdir().expect("tempdir");+ let model = Arc::new(tinyagents_harness::testkit::ScriptedModel::replies(vec!["ok"]));+ let model_for_host: Arc<dyn tinyinference_llm::model::ChatModel<()>> = model.clone();+ let mut host = crate::agent::SessionHostBuilder::new()+ .chat_model(model_for_host)+ .tools(crate::agent::goals::goal_tools(action_dir.path()))+ .action_dir(action_dir.path().to_path_buf())+ .workspace_dir(action_dir.path().to_path_buf())+ .tool_dispatcher(Box::new(tinytools_agent::dialect::XmlDialect))+ .build()+ .expect("session build");+ host.set_thread_id(None);+ host.ensure_runtime_session().expect("runtime session");++ let dumped = host+ .render_current_turn_prompt()+ .expect("debug prompt surface");+ host.run_single("hello").await.expect("scripted turn");+ let request = model.requests().into_iter().next().expect("model request");+ let sent = request+ .messages+ .iter()+ .filter_map(|message| match message {+ tinyinference_llm::message::Message::System(system) => Some(+ system+ .content+ .iter()+ .filter_map(|block| match block {+ tinyinference_llm::message::ContentBlock::Text(text) => Some(text.as_str()),+ _ => None,+ })+ .collect::<String>(),+ ),+ _ => None,+ })+ .collect::<String>();++ assert_no_goal_tools(&sent, &ToolSnapshot::default());+ assert_eq!(dumped, sent, "debug dump must equal the real cold-turn system prompt");}fn assert_no_goal_tools(prompt: &str, snapshot: &ToolSnapshot) {