Run Inspect
run_inspectRetrieve the status and output of a background run submitted via run_submit. Poll while running, then receive the full result once finished, including stdout, exit code, and verdict.
Instructions
Poll a background run started with run_submit.
While running: {"ok": True, "state": "running"|"cancelling", "run_id", "provider_id", "started_at", "deadline"}.
Once terminal (state "finished"/"cleaned"/"recovered"), this returns
the SAME result shape execute_code returns — stdout/stderr/exit_code/
verdict/unenforced/provider (the interface_version/provider_id/limits
receipt)/... — merged with a small set of run_* extras (run_id,
provider_id, started_at, deadline, state, cleaned; see server.py's
_RUN_EXTRA_KEYS). This terminal reply carries the same
anthropic/maxResultSizeChars _meta execute_code advertises (see
server.py's _LARGE_RESULT_TOOLS) — it is the same envelope, once the
run started with run_submit has finished, and run_submit's own
max_output_kb is clamped the same way execute_code's is so that value
stays true here too. Read ok and verdict on a terminal result to tell
a clean finish from a failure; a run stopped by run_cancel is only
reflected there for a provider that actually supports cancellation (see
run_cancel's own docstring) — check the result the same way you would
any other run.
Retention: a finished run's result stays inspectable for the life of this server process — call this as many times as you like; nothing is consumed by reading it. What IS released on the first terminal read is the PROVIDER's own resources for that run (RunSupervisor.cleanup(), idempotent on repeat calls) — the in-memory record of the run itself is not evicted; there is no cap or TTL on it here, deliberately: the durable state machine, leases and TTL-based eviction are out of this residual's scope (see run_supervisor.py's own docstring). A long-lived server that calls run_submit very many times will grow this table; the on-disk crash-recovery journal underneath it is already bounded (RunSupervisor.max_completed), independent of this.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| run_id | Yes | Id of a background run, as returned by run_submit |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||