Skip to content

v0.3.0: queue hardening

Choose a tag to compare

@eadwinCode eadwinCode released this 16 Sep 14:40
· 120 commits to main since this release

Queue hardening for overload and queued-not-started runs. Go module github.com/eadwinCode/agentic-kit/packages/go-agentenkit@v0.3.0, npm agentenkit@0.3.0 and use-agentenkit@0.3.0.

Breaking changes

  • ports.Queue gained Cancel, Find and Stats; custom queue adapters must implement them (ErrUnsupported is allowed for Find and Stats).
  • ports.Kv gained SetIfValue, DelIfValue and IncrWithExpiry; custom kv adapters must implement them.
  • A run is now QUEUED between enqueue and pickup. Anything that treated RUNNING as "accepted" (state filters, activity checks, UI labels) must include QUEUED. The React hook and the TS types carry it.
  • SettledAt is stamped only when the settle hook succeeded; a failed settle is retried by SettleLate.

Queue

  • Depth cap (MaxDepth, ErrQueueFull) on fresh dispatches only; payload, age, attempts and run-time limits; backoff between attempts; a drain on Close.
  • Namespace per deployment, fair claim across partition keys, priority, dedupe keys, job kinds, a logger.
  • Dead letters with DeadHandler, ListDead, Redrive, PurgeDead, Purge, Delete, Pause, Resume.
  • The Postgres consumer wakes on NOTIFY; polling is a slow backstop.

Core

  • Renewed run lock by compare-and-set; per-run counters with an expiry.
  • Step, segment and queue-wait deadlines; retry backoff for runs.
  • BillingPreCheck at dispatch and at pickup with a lowerable RunBudget.
  • ReclaimStuckRuns, HandleDeadJob, FailLostRun, SettleLate; unknown agents fail the run.
  • Keyed park expiries cancelled on answer; answers written once; cancelled contexts re-enqueue the run.

Full details in #9.