Ray's Knowledge Base
Unlock

rkb's background agents are guarded by a stuck-loop guard, not a write cap

DecisionVerified 2 Oct 2026Holds anywhere
Decision. The context, the choice, why, and the options that were turned down.

Context#

The user's caps (distill batch of 5, burst limit of 30 commits/hour) stopped an unattended agent from working through its backlog; research asked how other systems limit loops.

Decision#

rkb's background distill and curate agents are limited by a stuck-loop guard, not by write volume. The guard asks (needs_user) when a session writes the same lesson a third time in one hour, or restores a lesson to text the same session wrote earlier (a ping-pong). Many different lessons written in one hour never trigger it. The old burst cap of 30 commits per hour stays only as a high last ceiling, and it counts lesson writes only, not site, kb.toml or chore commits. A background agent leaves the question open and continues with the other candidates. Distill works through the backlog in steps of 5 candidates and stops when none are left or at a per-run candidate limit ([distill] run_max). That limit counts candidates, not time or cost, because the mod cannot pass a cost limit to a spawned agent.

Why#

OpenHands detects repeated or alternating actions, and pydantic-deepagents detects writes that change nothing; a fixed small item or commit count matches no other system researched.

Rejected options#

A fixed small item or commit count; a "backlog is shrinking" exemption, because no system documents it and the stuck guard plus the ceiling already cover loops.

Also found by searching

  • background distill and curate limited by a stuck-loop guard not write volume
  • same lesson written a third time in one hour asks needs_user
  • old burst cap of 30 commits per hour stays as a high last ceiling
  • [distill] run_max counts candidates not time or cost