Skip to main content
Use asynchronous reset operations between evaluation attempts to restore the baseline captured when you provisioned a Twin Run. Arga clears each twin’s state and replays that baseline without restarting the VM. Writes made after provisioning are not part of the baseline. A reset can take longer than an HTTP client’s timeout. Start the operation once, save its ID, and poll for completion. The operation continues if your connection closes or the API restarts.

Before you start

  • Wait for the Twin Run to reach ready.
  • Stop agent and application traffic to its provider endpoints. Provider requests are blocked while the run is resetting.
  • Check the run’s expiry and extend its TTL if needed. Reset does not extend the TTL; teardown and expiry can cancel the operation.
Use your Arga API key for these calls, rather than a provider token returned by the twin.

Start a reset

This example requires curl and jq. Set ARGA_API_KEY in your environment, then choose your run ID and an idempotency key for this reset:
The start endpoint returns HTTP 202, an operation_id, and a relative status_url. The Location header contains the same status URL. Retry-After: 2 suggests polling every two seconds. Save the run ID, idempotency key, and operation ID so you can resume after a process restart. If the POST times out before you receive a response, repeat it with the same key. Arga returns the existing operation if it was already accepted. Reusing a key also returns the same operation after it finishes. Use a new key for each intentional reset, such as the next evaluation attempt. A different key while a reset is active returns 409; it does not start a second reset.

Poll until completion

Poll the returned URL with the same Arga API key:
If a polling request fails, resume GET requests to the same URL. A lost response does not cancel the reset or require a new POST. Only resume your evaluation after status is succeeded. The operation response includes timestamps and timeout_seconds. The server’s default reset budget is 900 seconds, including queue time; use the returned value for the operation. A GET can return HTTP 200 with status: "failed" or "cancelled", so check the JSON status as well as the HTTP status.

Handle timeouts and older runs

A client-side timeout means you stopped waiting for a response. Check the existing operation before deciding whether to abandon the environment. Teardown cancels an active reset; do not tear down solely because one HTTP request exceeded 60 seconds. If starting a reset returns 409 with Async reset requires an updated worker. Reprovision after the worker rollout., provision a new Twin Run and retry there. Older runs cannot accept durable reset operations. The synchronous POST /validate/twins/provision/{run_id}/reset route remains available. The Python and TypeScript SDK reset() helpers currently use that route and wait for the result. Awaiting an SDK method, including on Python’s AsyncArga, does not by itself use the durable start-and-poll API. Use the HTTP endpoints above when you need a saved operation ID and safe admission retries.