Cleanup can arrive after the machine is gone.
Mainbrella published a sandbox adapter for the Deep Agents harness. The implementation lives in a fork while an upstream feature request remains open. Its useful idea is smaller than the full integration. A sandbox ID contains both a reusable slot and the container's creation time.[1][2]
The adapter returns IDs such as small@2026-10-08T09:25:17.059Z. It rejects a bare slot name. Before attach or delete, it checks that both the slot and creation time still name a running container. A cleanup request for an old generation cannot silently attach to the replacement.[2]
The handle used to start work must still identify the same machine when work stops.
This is a lifecycle contract.
Deep Agents separates graph state from the filesystem and shell backend. Its architecture document says LangGraph owns conversation state and checkpoints. The backend decides where files and command execution live. A checkpoint can remember that a report existed after the sandbox disk has disappeared.[3]
The official sandbox guide adds the operating cost. Sandboxes consume resources until shutdown. Applications need an explicit scope, mapping, time to live, and cleanup path. Its examples create a sandbox before agent work and stop it in a finally block.[4]
That means the receipt needs two clocks. The agent run has a thread or checkpoint lifetime. The machine has a creation time and deletion result. Do not infer one from the other.
Retries split at the side-effect boundary.
The Mainbrella adapter accepts an idempotency key when creating a machine. If the reply disappears after creation, a retry can reconcile the original request instead of starting another container. The adapter does not apply the same rule to shell commands or file writes. Repeating those operations could repeat their side effects.[1][2]
Record which call can be replayed. Creation may have a stable key. Attach should require an exact generation. Command execution needs its own operation-level idempotency or a fresh observation before retry. Cleanup should report that the addressed generation stopped or was already absent.
The integration is real, but not upstream.
The forked commit adds the langchain-mainbrella package, provider code, tests, and dcode --sandbox mainbrella wiring. The upstream issue was open and awaiting triage when read. This is a working vendor implementation and proposal, not a released Deep Agents provider in the upstream repository.[2]
The vendor reports eight backend tests and eight command-line integration tests against its local service. Those results support the stated integration paths. They do not prove model task quality, comparative reliability, or production fitness.[1]
Keep the machine receipt short.
SLOT=small GENERATION=2026-10-08T09:25:17.059Z CREATE_KEY=[REQUIRED] THREAD_ID=[REQUIRED] CHECKPOINT_ID=[REQUIRED] OUTPUT_EXPORTED=[YES / NO] STOP_TARGET=small@2026-10-08T09:25:17.059Z STOP_RESULT=[REQUIRED] REPLACEMENT_GENERATION=[NONE / ID]
Store the full machine ID. Save durable output before stop. Keep the stop result beside the generation it addressed. If a new machine inherits the slot, the old receipt should fail closed.