May 22, 2026
No More Iteration Caps, No More Silent Memories
Chalie can now think for as long as a task needs and can finally recall the behavioral patterns it had been quietly collecting all along.
Two unrelated bugs, same root cause: Chalie was building up knowledge about itself and its own limits that it wasn’t allowed to use. Today I fixed both — one in how long it’s allowed to think, one in what it’s allowed to remember.
The bigger fix: user-facing conversations had a hard iteration cap. If a task took more reasoning steps than the cap allowed, the loop stopped whether or not the work was done. That’s a bandage over a real problem — the actual failure mode is a runaway loop that never terminates, and a fixed cap “solves” that by also killing legitimate long tasks. I replaced it with cooperative cancellation: a threading.Event a stop signal can set at any point, checked between iterations, so the loop keeps going as long as it’s making progress and only stops when told to or when it’s actually done. New POST /chat/stop and POST /chat/subagent/<id>/stop endpoints let the frontend pull that trigger, with a stop button and a subagent activity panel so you can see what’s running before you kill it. Background processors nobody’s watching — dream cycles, pattern extraction — keep their caps, since cooperative cancellation only works when something can cooperate. User-facing work should run until finished or stopped; unsupervised background work still needs a backstop.
The second bug was quieter and more embarrassing: 38 behavioral patterns Chalie had already extracted from past conversations were sitting in the memory graph, fully computed, and never once surfacing in recall. The recall search’s kind filter simply didn’t include behavioral_pattern as a category to search — a bug that throws no error, so a whole class of self-knowledge quietly does nothing forever and nobody notices. Once that was wired in, a second bug showed up right behind it: when a pattern got rediscovered instead of created fresh, only the raw value blob updated — the reinforcement columns (evidence count, storage strength, retrieval weight) never moved. Every “seen this again” signal was silently discarded; patterns decayed with age but never got stronger from repetition, no matter how many times they proved true. Both are now fixed, tested, and rendering into a compact, LLM-readable form at recall time.
Alongside those, I started (and mostly reverted) work on a self-reference tool that would let Chalie answer “what is Chalie” or “what tools do you have” by pointing at its own live documentation instead of hardcoding a description that goes stale the moment something ships. It went in, got pulled back out, then went back in again by end of day — visibly messy, but the end state is a working ability with an updated architecture doc. I also closed out hygiene: SonarCloud findings (a log-injection risk from an unescaped identifier, a couple of unused variables), a Brain UI gap where OpenAI-compatible providers couldn’t list their own models, and an installer bug where re-running the installer to upgrade silently skipped re-downloading the source — “upgrade” did nothing.
None of this is flashy, but it’s the kind of day that compounds: a chat that can finish long tasks instead of getting cut off mid-thought, and a memory system that uses what it already knows instead of sitting on it. Both bugs share the same shape — capability that existed but wasn’t wired up to fire — and that’s the pattern I’m watching for across the rest of the system.
- Removed hard iteration caps on user-facing chat; replaced with cooperative cancellation via
threading.Eventand new stop endpoints - Fixed behavioral patterns being fully excluded from memory recall search — 38 stored patterns now actually surface
- Fixed pattern reinforcement so rediscovered patterns update evidence count and storage strength instead of just the raw value
- Added a stop button and subagent activity panel so you can see and interrupt long-running work
- Fixed the installer silently skipping re-downloads on upgrade, and Brain UI model listing for OpenAI-compatible providers