Follow Discord
Sweep 20 Nov 2026 · 19:55Z Build v2.1.330 547 read Stable v2.1.323 Latest v2.1.330 Next v2.1.330 Feeds RSS JSON llms.txt llms-full.txt Unofficial
One change · api

self-hosted-sandboxes-operations changedmanaged-agents/self-hosted-sandboxes-operations

Nearest release: v2.1.330, published under an hour before this site recorded the change. Shown because the two are within 24 hours of each other. Nothing here says the release caused the edit.

Recorded here
Lines+22added
Lines−22removed
From line 49 where the diff opens
First seen 2 Oct 2026 this site's first read of the page
Recorded edits19to this page, all time

The whole hunk

from line 49, old and new numbered
/
lines
from line 49
4949 
5050`GET /v1/environments/{environment_id}/work/stats` (python, typescript, ruby: `client.beta.environments.work.stats()`; go, csharp: `client.Beta.Environments.Work.Stats()`; java: `client.beta().environments().work().stats()`; php: `$client->beta->environments->work->stats()`; cli: `ant beta:environments:work stats`) returns the queue state for an environment:
5151 
52| Field | Meaning | Use it to |
53| ------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
54| `depth` (csharp, go: `Depth`) | Items waiting to be claimed. | Scale your worker fleet or alert on backlog. |
55| `pending` (csharp, go: `Pending`) | Items claimed by a worker but not yet acknowledged. The worker helpers acknowledge each item before processing it, so this stays near zero in normal operation. | Detect a worker that stalled between claiming and acknowledging: alert on a sustained non-zero value. |
56| `oldest_queued_at` (java, php: `oldestQueuedAt`; csharp, go: `OldestQueuedAt`) | Timestamp of the oldest item still in the queue, either waiting to be claimed or claimed but not yet acknowledged. `null` (python: `None`; ruby: `nil`; java: `Optional.empty()`; go: `""`) when there is no such item. | See how long the oldest item has waited. |
57| `workers_polling` (java, php: `workersPolling`; csharp, go: `WorkersPolling`) | Workers that have polled in the last 30 seconds. | Alert on liveness. |
52| Field | Meaning | Use it to |
53| ----- | ----- | ----- |
54| `depth` (csharp, go: `Depth`) | Items waiting to be claimed. | Scale your worker fleet or alert on backlog. |
55| `pending` (csharp, go: `Pending`) | Items claimed by a worker but not yet acknowledged. The worker helpers acknowledge each item before processing it, so this stays near zero in normal operation. | Detect a worker that stalled between claiming and acknowledging: alert on a sustained non-zero value. |
56| `oldest_queued_at` (java, php: `oldestQueuedAt`; csharp, go: `OldestQueuedAt`) | Timestamp of the oldest item still in the queue, either waiting to be claimed or claimed but not yet acknowledged. `null` (python: `None`; ruby: `nil`; java: `Optional.empty()`; go: `""`) when there is no such item. | See how long the oldest item has waited. |
57| `workers_polling` (java, php: `workersPolling`; csharp, go: `WorkersPolling`) | Workers that have polled in the last 30 seconds. | Alert on liveness. |
5858 
5959<CodeGroup>
6060 ```bash cURL
from line 334
334334 
3353351. **Make sure SIGTERM and SIGINT cancel the worker.** How depends on the worker:
336336 
337 | Worker | What to do |
338 | ---------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
339 | `ant` CLI | Nothing. The CLI handles both signals itself: it cancels any in-flight tool call, posts its error result, and marks the work item `stopped`. |
340 | SDK worker that is its own process | `EnvironmentWorker` installs no signal handlers. Cancel the worker from a signal handler, as the standalone worker examples do. |
341 | SDK worker inside a webhook server | Cancel the worker from the server’s own shutdown hook, as the webhook examples do. The worker must not take over the server’s signals. |
337 | Worker | What to do |
338 | ----- | ----- |
339 | `ant` CLI | Nothing. The CLI handles both signals itself: it cancels any in-flight tool call, posts its error result, and marks the work item `stopped`. |
340 | SDK worker that is its own process | `EnvironmentWorker` installs no signal handlers. Cancel the worker from a signal handler, as the standalone worker examples do. |
341 | SDK worker inside a webhook server | Cancel the worker from the server’s own shutdown hook, as the webhook examples do. The worker must not take over the server’s signals. |
342342 
3433432. **Stop the worker with SIGTERM, and give it time to finish before any hard kill.** The worker needs time to end an in-flight tool call and to upload changed files to a memory store. Docker sends SIGKILL 10 seconds after the stop signal by default. Raise that limit with `--stop-timeout 60` (python: `--stop-timeout 210`) on `docker run`, or set your orchestrator’s termination grace period to the same number of seconds.
344344 
from line 362
362362* **A sync failure:** The worker writes the failure to its log and doesn’t report it to the session.
363363* **A refused write to a read-only store:** The agent gets a tool error. See [Read-only stores and conflicts](https://platform.claude.com/docs/en/managed-agents/self-hosted-sandboxes-memory#read-only-stores-and-conflicts).
364364 
365| Symptom | Cause | Fix |
366| --------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
367| The worker log contains `the work item carried no sessions token` (in Go, the `ErrSessionMemoryNoToken` error) and the work item fails. | The work item’s per-session `secret` (csharp, go: `Secret`) did not reach the worker. Either your code did not forward it, or memory stores on self-hosted sandboxes are not enabled for your organization. | [Forward the work item’s secret](https://platform.claude.com/docs/en/managed-agents/self-hosted-sandboxes-per-session#forward-the-work-items-secret). If the worker polls and runs sessions in one process and still logs this, contact support. |
368| The worker log contains `something already exists at the memory store's path`. | Another session on the same filesystem is using that path. Or a previous session’s worker was killed before its teardown ran, so the directory stayed behind. | Check whether a worker still runs a session that uses that path. If one does, do not remove the directory: the worker removes it when it finishes with the session. If none does, remove the directory that the log line names. Edits in it that had not synced are lost. To run two such sessions at once, see [Isolate sessions that share a store](https://platform.claude.com/docs/en/managed-agents/self-hosted-sandboxes-memory#isolate-sessions-that-share-a-store). |
369| The worker log contains `cannot create the memory store's folder` and `the worker host must make this mount path writable`. | The user the worker runs as cannot create directories under `/mnt/memory`. | Create `/mnt/memory` and `chown` it to that user. See [Prepare the host](https://platform.claude.com/docs/en/managed-agents/self-hosted-sandboxes-memory#prepare-the-host). On macOS, follow [Prepare a macOS host](https://platform.claude.com/docs/en/managed-agents/self-hosted-sandboxes-memory#prepare-a-macos-host) instead. |
370| The session sits `idle` with a `requires_action` stop reason and no error event shortly after a worker claimed it. | The worker failed the work item because it could not mount a memory store, for one of the preceding reasons. | Fix the cause on the host, then send a [`user.interrupt`](https://platform.claude.com/docs/en/managed-agents/events-and-streaming#interrupt-the-agent) event. The session’s work is queued again, and the next worker that claims it retries the mount. |
365| Symptom | Cause | Fix |
366| ----- | ----- | ----- |
367| The worker log contains `the work item carried no sessions token` (in Go, the `ErrSessionMemoryNoToken` error) and the work item fails. | The work item’s per-session `secret` (csharp, go: `Secret`) did not reach the worker. Either your code did not forward it, or memory stores on self-hosted sandboxes are not enabled for your organization. | [Forward the work item’s secret](https://platform.claude.com/docs/en/managed-agents/self-hosted-sandboxes-per-session#forward-the-work-items-secret). If the worker polls and runs sessions in one process and still logs this, contact support. |
368| The worker log contains `something already exists at the memory store's path`. | Another session on the same filesystem is using that path. Or a previous session’s worker was killed before its teardown ran, so the directory stayed behind. | Check whether a worker still runs a session that uses that path. If one does, do not remove the directory: the worker removes it when it finishes with the session. If none does, remove the directory that the log line names. Edits in it that had not synced are lost. To run two such sessions at once, see [Isolate sessions that share a store](https://platform.claude.com/docs/en/managed-agents/self-hosted-sandboxes-memory#isolate-sessions-that-share-a-store). |
369| The worker log contains `cannot create the memory store's folder` and `the worker host must make this mount path writable`. | The user the worker runs as cannot create directories under `/mnt/memory`. | Create `/mnt/memory` and `chown` it to that user. See [Prepare the host](https://platform.claude.com/docs/en/managed-agents/self-hosted-sandboxes-memory#prepare-the-host). On macOS, follow [Prepare a macOS host](https://platform.claude.com/docs/en/managed-agents/self-hosted-sandboxes-memory#prepare-a-macos-host) instead. |
370| The session sits `idle` with a `requires_action` stop reason and no error event shortly after a worker claimed it. | The worker failed the work item because it could not mount a memory store, for one of the preceding reasons. | Fix the cause on the host, then send a [`user.interrupt`](https://platform.claude.com/docs/en/managed-agents/events-and-streaming#interrupt-the-agent) event. The session’s work is queued again, and the next worker that claims it retries the mount. |
371371 
372372### A custom tool call never returns
373373 
from line 377
377377 
378378Without a timeout on the MCP client, a hung call to a [wrapped MCP server](https://platform.claude.com/docs/en/managed-agents/self-hosted-sandboxes-custom-tools#wrap-an-mcp-server-as-custom-tools) becomes an error tool result only when a backstop fires:
379379 
380| SDK | Backstop | Fires after |
381| ---------- | -------------------------------------------------------------- | ----------------- |
382| Python | The worker’s own tool call limit | About 2.5 minutes |
383| TypeScript | The MCP SDK’s default request timeout | About a minute |
384| Go | The worker cancels a tool call that outlives its default limit | 120 seconds |
380| SDK | Backstop | Fires after |
381| ----- | ----- | ----- |
382| Python | The worker’s own tool call limit | About 2.5 minutes |
383| TypeScript | The MCP SDK’s default request timeout | About a minute |
384| Go | The worker cancels a tool call that outlives its default limit | 120 seconds |
385385 
Feedback