From b649a11645fd5a7b66e0b0207e61d0c552363b8a Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Wed, 15 Apr 2026 21:58:03 -0400 Subject: [PATCH] hours_since_last_dream: return 0 if dream in progress The function was reading from dream-log.jsonl which only updates when dreams complete. If a dream session was started but not yet ended, it would show stale hours. Now checks for active dream state first. Co-Authored-By: Proof of Concept --- src/thalamus/idle.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/thalamus/idle.rs b/src/thalamus/idle.rs index 6c78b19..71baa81 100644 --- a/src/thalamus/idle.rs +++ b/src/thalamus/idle.rs @@ -372,6 +372,10 @@ impl State { } pub fn hours_since_last_dream() -> u64 { + // If a dream is currently in progress, no nudge needed + if home().join(".consciousness/state/dream-state").exists() { + return 0; + } let path = home().join(".consciousness/logs/dream-log.jsonl"); let content = match fs::read_to_string(path) { Ok(c) if !c.is_empty() => c,