Skip to main content
A request can reach the service and perform its effect even if the caller never receives the reply. Preserve the original target and intent, then recover from observed facts. The SDK does not automatically retry or create a replacement. Use this guide with the error vocabulary and the specific capability’s lifecycle.

Before an operation

For Create Computer, Create Sandbox, Clone and Snapshot Create, save one unique idempotency_key with the exact request and source identity before sending it. A retry of the same intent must use the same key, Memory and source where applicable. Do not generate the key inside a general retry callback. Do not change the requested Memory while retaining a key for an uncertain Create. Do not reuse a key for unrelated tasks. An idempotency key identifies that supported creation intent; it is not a universal header or cancellation token. Other methods do not gain idempotency by adding an undocumented field.

Classify the result

  1. A valid success lets you continue from its result. If it is marked no-retry, do not replay the completed effect.
  2. A known refusal tells you which prerequisite to correct. A safe refusal may be retried explicitly after the condition clears and any stated delay.
  3. A query-first result or lost mutation reply requires observation. Keep the original object and input even when the first read is inconclusive.
Never use “the request timed out” as evidence that the original Computer is gone, a Secret change failed, or a command did not run.

Retry a refused action (EXEC_BUSY, LIFECYCLE_BUSY, RATE_LIMITED)

LIFECYCLE_BUSY, EXEC_BUSY, and RATE_LIMITED all return HTTP 429 with retry: "safe". The action was rejected before dispatch, and HTTP Retry-After equals error.retry_after_seconds. Wait at least that returned interval, then explicitly retry only the rejected step if the original intent remains needed.
  • LIFECYCLE_BUSY: Applies to Computer Create/Delete/Start/Stop/Resize/Clone, Snapshot Create/Delete/Restore, Storage Reclaim, and Sandbox Create/Delete/Start/Stop. Keep the exact original target and request. Where the operation supports an idempotency key—Computer or Sandbox Create, Clone, or Snapshot Create—reuse the original saved key; do not allocate a new intent.
  • EXEC_BUSY: Applies to shared Account command capacity (Exec, Tools, Desktop setup).
  • RATE_LIMITED: Applies to bounded human/public actions such as invites.redeem.
For a Stop→Resize→Start sequence, retry only the refused step. Do not repeat a completed Restore, delete data again, or restart the whole workflow. A lost response or UNKNOWN / query-first still requires observation; it does not become a known pre-dispatch refusal. If Create or Clone fails with LIMIT_EXCEEDED (memory or persistent_computers), do not loop retries—free capacity or delete unneeded Computers first.

Recover a creation intent

The preferred first read is the original object’s Get when a real ID is known. Otherwise list the owned objects and inspect likely results. A display name or a list entry alone may not conclusively identify a creation intent. If observation remains insufficient, recover using the identical saved request for the same creation key. This is continuation of one intent, not authorization for a new one. An uncertain source/source-ID must not be replaced. For example, after the caller has observed current resources and retained the original input:
The program is an explicit recovery tool, not an automatic polling loop. If the intent has become unwanted or its identity is ambiguous, do not run the write step. Resolve the original result first, then handle that exact asset. For a Sandbox, repeating the original creation key does not renew its expires_at. After its lifetime, do not treat replay as a renewal API.

Recovery by operation

A read can itself be unknown. Stop adding mutations while the original effect remains unresolved. Keep evidence and use the support path with non-secret identifiers.

One-time values need a different recovery

Agent Key and Share creation return a raw secret/link only once. A metadata list proves records, not the lost secret value. For a lost Agent Key, identify and revoke the affected key before creating a replacement. For an uncertain Share, inspect metadata and decide which exact record should be revoked before intentionally making another link. Do not assume the first request failed merely because its URL was lost. Vault metadata never reveals an existing raw value. A read-back of metadata is not a method for extracting the Secret.

Avoid automatic cascades

Do not make UNKNOWN trigger create → stop → delete → recreate. This can produce duplicate effects, lose the original disk or stop unrelated work. Do not make a resource refusal trigger automatic shrinking of another Computer. A running shrink requires an explicit interruption decision and the stated Stop→Resize→Start path. Do not make a Viewer failure restart the entire Computer. Access sessions, app readiness and Machine lifecycle are different facts.

Retry only the smallest known step

If a command was refused with EXEC_BUSY, wait the indicated interval and retry that command. If a tool download failed, inspect that tool and connectivity. If a stopped service makes Share return 503, restore the intended service on the original Computer. After recovery, verify the user’s actual result, then clean up only the explicitly selected temporary work. The goal is a known outcome on the original assets, not a green response achieved by starting over.