diff --git a/src/agent/oneshot.rs b/src/agent/oneshot.rs index 59bc317..b0d6a33 100644 --- a/src/agent/oneshot.rs +++ b/src/agent/oneshot.rs @@ -85,6 +85,7 @@ pub fn set_stats(name: &str, stats: PersistedStats) { /// Save agent conversation to JSON log file. /// Used by both mind-run agents and CLI-run agents. pub async fn save_agent_log(name: &str, agent: &std::sync::Arc) -> RunStats { + assert!(!name.is_empty(), "save_agent_log called with empty name"); let dir = dirs::home_dir().unwrap_or_default() .join(format!(".consciousness/logs/{}", name)); let ctx = agent.context.lock().await; @@ -231,6 +232,7 @@ impl AutoAgent { temperature: f32, priority: i32, ) -> Self { + assert!(!name.is_empty(), "AutoAgent::new called with empty name"); Self { name, tools, steps, current_phase: String::new(),