Agents

Cancel an agent run

Stops a running run where it is: the model call in flight is abandoned and no further action is taken. What it already did to the desktop stands, and so does what it cost. The run answers as cancelled. Cancelling a run that already ended answers it as it is, unchanged. A run this key cannot see is a 404.

Requires the member role or higher.

post/agent/runs/{run}/cancel

Request

  • Base URL: https://app.mandala.computer/api/v1
  • URL: https://app.mandala.computer/api/v1/agent/runs/{run}/cancel
  • Auth: HTTP bearer

Path parameters

runstring required

A run id from POST /computers/{id}/agent/runs (run_ followed by 24 lowercase hex characters).

Response

The run.

idstring required

run_ and twenty-four hex characters.

computer_idstring required
thread_idstring nullable required

The thread the run is kept in, once it is: null until a new thread has something in it (a run that has not acted yet, or failed before it did), and when the thread was deleted. Continue it with thread_id on the next run.

status'running' | 'completed' | 'failed' | 'cancelled' | 'interrupted' required

completed: the loop ended on its own, and result.stop says how — only end_turn means the task was finished. failed: see error. cancelled: stopped by a cancel. interrupted: the control plane restarted while it was going (error.status 503), or the run stopped without its ending being recorded (error.status 500); it was not resumed.

promptstring required

The prompt, at most 32,000 characters of it.

modelstring required

The model the run was started with.

max_stepsinteger required
stepsinteger required

How many actions it has taken so far.

cost_usdnumber

Funded runs: the charge so far, in USD.

created_atstring required
updated_atstring required

When it last took a step or changed status.

ended_atstring nullable required

When it ended; null while running.

Changes

No recorded changes to this operation across all 1 revision of this API.