v0.4.12
v0.4.12
The Build Loop, and multi-agent runs that keep going instead of timing out.
Highlights
-
The Build Loop. A new opt-in workflow runs a task through plan → implement → verify → review → merge, with the verifier checking the worker's actual edits in an isolated worktree and a merge gate that only lands changes when verification is green and review is clean:
/build add rate limiting to the API
-
It can escalate on its own. A multi-step request can enter the loop automatically; tune it with
cli.buildLoop(off/escalate/always, defaultescalate). -
Runs reconnect instead of timing out. Model calls and the memory connection now reconnect with backoff (honoring
Retry-After) rather than failing at a hard deadline, so slow models, large reviews, and brief network blips no longer kill a run. -
The session keeps going after spawning agents. When a turn ends with background agents still working, BrainRouter waits for them and continues automatically — no more manual
/continue. -
Type while it's busy. Messages entered mid-turn are queued and run one at a time after the current turn finishes:
/queue /queue remove 2 /queue clear
Improvements
- Child and worker timeouts wait instead of killing. A timeout now only bounds how long the parent waits; the child runs to completion. Use
timeoutMs: 0to wait until done. - Fan-out builds. A build split into multiple slices runs each in its own held worktree and merges them with overlap detection; review-gate ad-hoc workers with
cli.worktreeMergeReview. - Optional loop-until-green self-repair. When
cli.buildLoopMaxRepairsis greater than 0, a failed build retries implement → verify → review until it passes (default off). - Active phase, surfaced.
/ps,/agents, and an optional statusline segment now show the running phase (e.g.Implement (2/4)). - Search actually searches.
grep_searchnow does real regular-expression matching and accepts a single file or a directory. - Accurate costs.
/tokensnow includes tokens spent by child and sub-agents.
Also Included
- Worktree garbage collection no longer removes a running child's worktree.
- Worker-thread state moved under your BrainRouter home directory.
- Workflow agents with custom role names map to the closest built-in role instead of failing.