run_inspect
Retrieve the current status and final result of a background run. Poll until the run reaches a terminal state, then read stdout, stderr, 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). 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 |