Skip to main content

Module goal

Module goal 

Source
Expand description

The self-correcting goal watchdog. A supervisor-level periodic check — it never blocks the agent loop — of whether the configured goal is achieved, or the agent is stuck (no progress across stuck_after checks):

  • achievement is judged CEL-condition first (a cheap deterministic predicate over the live status), then an LLM judge for fuzzy goals (check.via: agent|both) — run asynchronously on an executor thread and folded back via Event::Background, so it never blocks the loop;
  • progress is a monotonic activity signal (finished runs + turns); when it stalls for stuck_after cycles the watchdog self-corrects;
  • dispositions: on_achievedfinish (drain, exit 0) / idle (stop checking) / {workflow} (run it); on_stuck{workflow} (a recovery / re-plan workflow — the concrete self-correction) / replan / escalate / idle / finish.

The check runs on a durable {"kind":"goal"} timer, so its cadence survives a restart.