From eae8d9291805094dd6b3d0d7d86df2f86e237326 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Fri, 10 Apr 2026 02:39:50 -0400 Subject: [PATCH] Tune subconscious agent trigger intervals Fix interval=0 agents firing when there's no new conversation content. Adjust intervals: observe=1KB, journal/reflect=10KB. Co-Authored-By: ProofOfConcept --- src/mind/subconscious.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/mind/subconscious.rs b/src/mind/subconscious.rs index 7ea9ae4..7fbbde9 100644 --- a/src/mind/subconscious.rs +++ b/src/mind/subconscious.rs @@ -278,11 +278,11 @@ use crate::subconscious::defs; /// Names and byte-interval triggers for the built-in subconscious agents. const AGENTS: &[(&str, u64)] = &[ - ("subconscious-surface", 0), // every trigger - ("subconscious-observe", 0), // every trigger - ("subconscious-thalamus", 0), // every trigger - ("subconscious-journal", 20_000), // every ~20KB of conversation - ("subconscious-reflect", 100_000), // every ~100KB of conversation + ("subconscious-surface", 0), // every new conversation content + ("subconscious-observe", 1_000), // every ~1KB of conversation + ("subconscious-thalamus", 0), // every new conversation content + ("subconscious-journal", 10_000), // every ~10KB of conversation + ("subconscious-reflect", 10_000), // every ~10KB of conversation ]; /// Snapshot for the TUI — includes a handle to the forked agent @@ -354,7 +354,9 @@ impl SubconsciousAgent { fn should_trigger(&self, conversation_bytes: u64, interval: u64) -> bool { if !self.auto.enabled || self.is_running() { return false; } - if interval == 0 { return true; } + if interval == 0 { + return conversation_bytes > self.last_trigger_bytes; + } conversation_bytes.saturating_sub(self.last_trigger_bytes) >= interval }