Skip to main content
DurableAgentQueue and DurableAgentWorker use a separate agentium-durable queue. Redis carries a versioned hint with tenant/task IDs and an immutable definition digest. The durable task store remains authoritative.

Wire the host boundaries

This typed host factory requires a supervisor with an initialized shared durable store, producer/worker admission callbacks, and an explicitly replay-aware driver. Install @agentium/core@4.0.0, @agentium/queue@4.0.0, bullmq, and ioredis as described in the queue quickstart. Calling the factory opens Redis-backed producer/worker resources.
A submitted task must reference the same driver ID and version. execute receives the durable execution context; recoverable: true is the host’s assertion that this implementation uses stable actions and handles reconciliation, not a switch that adds recovery to arbitrary code. Producer admission runs before persistence. Worker admission runs before and after claiming the task. Versioned drivers must support stable action IDs and reconciliation; wrapping an ordinary Agent function does not make it recoverable.

Recover delivery failures

Persistence precedes enqueue. If enqueue fails, retry the same immutable task definition or call wake({ tenantId, taskId }). Wake after approval or reconciliation as well. Duplicate delivery is fenced by the store; unknown effects block handler execution. cancel() persists cancellation and wakes a worker. It does not immediately terminate external work. The host retries wake when delivery fails and runs a recovery sweep for persisted tasks without a delivery hint. The package does not start a hidden store scanner. Stop workers and close producers as part of host shutdown. stop() drains owned work; effects still require their connector’s reconciliation contract.