nulltickets icon indicating copy to clipboard operation
nulltickets copied to clipboard

No API to list runs, get a run, or cancel a run

Open addadi opened this issue 3 months ago • 0 comments

Gap

The API can create/fail/complete runs and list a run's events, but there is no way to:

  • list runs (e.g. all runs for an agent, or all running runs)
  • fetch a single run's status/usage/error
  • cancel a pending or running run

Operators/agents currently have no server-side counterpart for basic run observability and lifecycle control.

Proposal

  • GET /runs — list, filters agent_id, status, limit 1..1000 (default 50), newest-first
  • GET /runs/{id} — single run incl usage_json + error_text; 404 unknown
  • POST /runs/{id}/cancel —
    • pending → terminal cancelled (ended_at_ms + error_text=note)
    • running → cancellation_requested event appended, status unchanged (executor polls events, then transitions)
    • terminal → already_terminal; unknown → 404
    • admin token required (not lease-gated)
  • openapi spec updates

PR incoming: feat/runs-observability-api (includes unit + e2e tests).

addadi avatar Aug 22 '26 14:08 addadi