Skip to main content

waitForCheckpointStatus

Agent Runtimes


Agent Runtimes / api/runtimes/checkpoints / waitForCheckpointStatus

Function: waitForCheckpointStatus()

waitForCheckpointStatus(token, runtimeUid, checkpointId, targetStatuses, baseUrl?, intervalMs?, timeoutMs?): Promise<RuntimeCheckpointData>

Defined in: src/api/runtimes/checkpoints.ts:193

Poll a checkpoint until it reaches one of the target statuses.

Useful for waiting until an async pause (status "paused") completes before proceeding. Checkpoint status stays "paused" during resume — only the agent runtime status transitions.

Parameters

token

string

Authentication token

runtimeUid

string

The runtime UID that owns the checkpoint

checkpointId

string

The checkpoint ID (ULID) to poll

targetStatuses

string[]

Set of statuses that signal completion (e.g. ["paused", "failed"])

baseUrl?

string = DEFAULT_SERVICE_URLS.RUNTIMES

Base URL for the runtimes API

intervalMs?

number = 2000

Polling interval in milliseconds (default: 2000)

timeoutMs?

number = 600_000

Maximum wait time in milliseconds (default: 600000 = 10 min)

Returns

Promise<RuntimeCheckpointData>

Promise resolving to the checkpoint data once a target status is reached

Throws

If polling times out or the request fails