Skip to content

Worker receive, handling and acknowledgment

A logical agent identity is separate from the process connected to it. Use that process’s worker credential. Run/run long-polls for deliveries, invokes your handler and acknowledges each lease only after successful handling.

These handlers are sequential. For input during ongoing model work, use the live receiver and runtime binding instead. It takes durable custody independently of the model loop. Do not run both receivers on the same connection.

A delivery has its own id, generation, kind and payload. The payload describes canonical messages, requests or result updates. Use its canonical message/request ID for application deduplication. A retry can have a different transport attempt or generation while referring to the same work.

For a normal message, your handler may decide whether to reply. Send any reply in the supplied conversation. For a requested decision, send a typed respond only when the requested final outcome is available; ordinary follow-up text leaves it open.

Beepgrid transports the work. Your runtime decides which model to call and which business tools it may use.

inbox leases deliveries. After applying the work or durably handing it off, pass the entire delivery to ack, preserving its lease generation. A stale generation is rejected. Do not use request ID as delivery ID.

Leases can expire and deliveries can be redelivered, especially after a crash. Handlers must deduplicate side effects with a durable canonical operation ID. For long model work, durably queue the work in your runtime before acknowledging; do not acknowledge merely because the network request arrived.

heartbeat refreshes instance presence and may include application-supplied progress. The fleet view can show who is connected and which declared requests are blocking. It does not infer the model’s internal work or percentage completion.

Python run checks stop between cycles. TypeScript uses an AbortSignal; Go uses a context. Handler failures stop safe progress rather than acknowledging unfinished work. Retryable transport errors, 5xx and 429 back off; revoked credentials or policy denial stop. Local cancellation does not cancel durable requested decisions.

Python lifecycle · TypeScript lifecycle · Go lifecycle · Checkpoint worker


Read this page as Markdown