Repository navigation
v0.6.2 — No lost turns under load
A memory fix that came straight from a reader's comment.
🐛 Fixed: turns lost before they reached long-term memory
On my daily.dev post, Ahmet Özel pointed out that sleeping at 24 pending turns with a 40-turn working memory is "headroom rather than a guarantee", and suggested a burst test with a slow summarizer. I ran it: with a 300 ms summarizer and 8 messages arriving during sleep, 10 of 26 turns never reached long-term memory.
Two causes, both fixed:
- Turns that arrived during sleep were trimmed away. They weren't part of the running consolidation, and working memory was cut to the last 6 turns afterwards. Now consolidation keeps every pending turn.
- The 40-turn cap evicted turns that were never consolidated. Now it only evicts turns already stored in an episode, and when pending turns reach the cap, the brain sleeps right away instead of waiting for the scheduler.
The burst test is now a regression test. Thanks, Ahmet!
Benchmark numbers are unchanged; 96 tests pass on Node 22 and 24.
Full changelog: CHANGELOG.md