Skip to content

v0.5.0 — Reactive Overflow Recovery

Choose a tag to compare

@junaidtitan junaidtitan released this 12 Feb 09:35
· 576 commits to main since this release

What's New

Reactive overflow recovery — When agent team sessions go idle, Claude's InboxPoller can deliver all queued teammate messages at once, spiking tokens from 101k → 205k in seconds. The guard's 30s polling loop can't catch this. Now it can.

New: Sub-second overflow detection

  • kqueue file watcher (macOS, 0.04ms latency) with os.stat() polling fallback (Linux, 200ms)
  • Detects "Conversation too long" overflow within milliseconds
  • Escalating recovery: gentle → standard → aggressive prescriptions
  • Auto prune → kill → resume (~10s downtime vs permanently dead session)
  • Circuit breaker prevents infinite recovery loops (max 3 in 5 minutes, then halts with checkpoint)
  • Zero impact on normal sessions — watcher runs silently, fast-path exits for small files
  • Disable with --no-reactive if needed

Changes

File Change
watcher.py NEW — kqueue/polling JSONL file watcher (stdlib only)
overflow.py NEW — CircuitBreaker + OverflowRecovery orchestrator
test_overflow.py NEW — 14 tests covering breaker, detection, watcher
guard.py Watcher thread alongside existing polling loop
cli.py --no-reactive flag

Install / Upgrade

pip install --upgrade cozempic

Addresses #23876.