Salambo
Browse documentation
OperateRuns and turns

Runs and turns

Understand durable runs, individual turns, sandboxes, and cancellation.

View Markdown

A run is the durable agent context. A turn is one accepted unit of work inside that run.

Ownership

ObjectOwns
DeploymentImmutable agent and sandbox configuration
RunPi session, workspace, active sandbox, and pinned deployment
TurnOne input, its execution state, output, and error
SandboxReplaceable compute for the run

Turn states

StatusMeaning
queuedAccepted and waiting to start
in_progressProvider or tool execution is active
cancellingCancellation is accepted and is settling
completedWork and required durability steps completed
failedExecution or required durability work failed
cancelledThe turn was intentionally cancelled
incompleteExecution stopped without a complete result

Run and turn states can differ

The run state reports whether the durable context can accept work. The turn status reports the selected unit of work.

For example, a cancelled turn can leave its run idle. The client can then submit a new turn to the same run. A run can stay busy after one queued turn is cancelled because another turn is still active.

Cancellation

Cancel current work:

http
POST /api/v1/runs/{runId}/cancel

Cancel a selected active or queued turn:

json
{
  "turn_id": "turn_01J..."
}

Cancellation:

  • requests an abort for active provider and tool work;
  • removes a selected queued turn;
  • settles the turn lifecycle;
  • stops active sandbox compute through run cleanup when required.

Deletion

Deletion is cleanup for an idle run. Do not use deletion as a substitute for cancellation of active work.