Skip to content

5dive 0.1.16 — heartbeat

Choose a tag to compare

@lodar lodar released this 28 May 14:32
· 114 commits to main since this release

Heartbeat — wake agents only when they have queued tasks

A per-agent scheduler that ties wake-ups to the shared task queue. Agents with no todo work never wake (zero tokens, 5h usage window untouched); when they do have work, they're nudged to do exactly one task per tick, then idle.

Commands

  • 5dive heartbeat on <name> [--every=30m] [--no-fresh] — enrol
  • 5dive heartbeat off <name> — disable
  • 5dive heartbeat ls — enrolled agents + next-wake + queued count
  • 5dive heartbeat tick — root cron driver

Behaviour per tick (per enrolled agent)

  • already in_progress → skip (no pile-on)
  • no todo → do nothing
  • has todo + due → ensure running, /clear (default), inject ONE nudge

fresh flag (default on)

Sends /clear before the nudge so each task starts from a clean conversation. The agent process itself stays running between ticks — no cold-start cost. --no-fresh keeps the running conversation across tasks.

Cron (root)

*/5 * * * * /usr/local/bin/5dive heartbeat tick >> /var/log/5dive-heartbeat.log 2>&1

Wired into the registry as .agents[<name>].heartbeat = {enabled, everyMin, fresh, lastRunAt} and surfaced in agent list --json for dashboard use.