diff --git a/src/subconscious/hook.rs b/src/subconscious/hook.rs index 6d4b4bd..cc21be0 100644 --- a/src/subconscious/hook.rs +++ b/src/subconscious/hook.rs @@ -192,9 +192,7 @@ impl AgentCycleState { if let Some(agent) = self.agents.iter_mut().find(|a| a.name == name) { agent.pid = pid; agent.phase = phase; - if log_path.is_some() { - agent.log_path = log_path; - } + agent.log_path = log_path; } } @@ -271,11 +269,8 @@ impl AgentCycleState { .unwrap_or(300) as u64; let live = crate::agents::knowledge::scan_pid_files(&state_dir, timeout); - if let Some((phase, pid)) = live.first() { - self.update_agent("surface-observe", Some(*pid), Some(phase.clone()), None); + for (phase, pid) in &live { self.log(format_args!("alive pid-{}: phase={}\n", pid, phase)); - } else { - self.update_agent("surface-observe", None, None, None); } // Read surfaced keys @@ -360,7 +355,6 @@ impl AgentCycleState { let live = crate::agents::knowledge::scan_pid_files(&state_dir, 300); if let Some((phase, pid)) = live.first() { - self.update_agent("reflect", Some(*pid), Some(phase.clone()), None); self.log(format_args!("reflect: already running pid {}\n", pid)); return None; } @@ -406,7 +400,6 @@ impl AgentCycleState { let live = crate::agents::knowledge::scan_pid_files(&state_dir, 300); if let Some((phase, pid)) = live.first() { - self.update_agent("journal", Some(*pid), Some(phase.clone()), None); self.log(format_args!("journal: already running pid {}\n", pid)); return; }