Skip to main content
A Turn is one submitted task. Once the service accepts a request, it can continue the same Turn after the client disconnects or an instance restarts. Save the request ID (requestId) when submitting and the task ID (turnId) when the receipt arrives. If submission times out, retry with the original request ID and input to retrieve the receipt. If you already have the Turn ID, use it to check the task or reconnect to its event stream. This guide covers production deployments where Brain calls the model directly and Hands runs external tools. MQ delivers task dispatches, tool commands, and results. PostgreSQL stores accepted work and execution progress. Deployments with object storage may keep large results and recovery data there. Redis carries live previews. The tables follow the last successfully saved step and apply to each round of reasoning and tool use in a Turn. Turn recovery architecture. The API dispatches Turns through MQ. Brain calls the model and uses MQ to send tool commands to Hands and receive results. Services recover from persistent storage. Live previews travel from Brain through Redis to the API. Task dispatch, tool execution commands, cancellations, and results all follow the same MQ rule. Until the sender records confirmation that MQ accepted a message, it may send the original message again. Once the confirmation is recorded, MQ handles delivery and any redelivery. The recipient can recognize duplicates.

Submission and model inference

Tool dispatch and execution

A provider with idempotent Sandbox creation can reopen the resource identified by the original creation receipt. The local POSIX adapter atomically publishes the initialized workspace and its identity marker together. Once ready, a missing workspace requires reconciliation. For example, a tool creates a support ticket and Hands restarts before saving the ticket number. If the external service can look up the ticket by the original call identity, Hands can recover its result. If lookup is unavailable and creation is not idempotent, issuing the command again could create a second ticket. An authorized operator should locate the original ticket and record the verified outcome against the original tool call.

Tool results, subsequent inference, and completion

When a task keeps waiting

When a service or connection is unavailable

For the APIs for Turn status, event subscriptions, pause and resume, and tool outcome verification, see the Durable execution guide.