From 3788695634f6bce56ee04fdead46be057b3bdf31 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Tue, 7 Apr 2026 02:37:11 -0400 Subject: [PATCH] Run subconscious collect/trigger on every event loop iteration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously only fired after conscious turn completion. Now runs on every wake — DMN timer, user input, background events. Subconscious agents get checked regardless of what woke the loop. Co-Authored-By: Proof of Concept --- src/mind/mod.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/mind/mod.rs b/src/mind/mod.rs index 5368d04..5fefbb3 100644 --- a/src/mind/mod.rs +++ b/src/mind/mod.rs @@ -442,13 +442,6 @@ impl Mind { if !self.config.no_agents { cmds.push(MindCommand::Score); } - - // Trigger subconscious agents after conscious turn completes - if !self.config.no_agents { - let mut sub = self.subconscious.lock().await; - sub.collect_results(&self.agent).await; - sub.trigger(&self.agent).await; - } } _ = tokio::time::sleep(timeout), if !turn_active => { @@ -459,6 +452,13 @@ impl Mind { } } + // Subconscious: collect finished results, trigger due agents + if !self.config.no_agents { + let mut sub = self.subconscious.lock().await; + sub.collect_results(&self.agent).await; + sub.trigger(&self.agent).await; + } + // Check for pending user input → push to agent context and start turn let pending = self.shared.lock().unwrap().take_pending_input(); if let Some(text) = pending {