logs: assert non-empty agent names, fix debug.log path

- save_agent_log: assert name is not empty (panic to find the bug)
- AutoAgent:🆕 assert name is not empty
- dbglog: write to daemon/ subdir instead of toplevel logs/

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
Kent Overstreet 2026-04-15 01:51:38 -04:00
parent bf5def4871
commit 4b710eb7a7

View file

@ -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<Agent>) -> 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(),