Skip to content

feat(runs): GET /runs, GET /runs/{id}, POST /runs/{id}/cancel - #10

Open
addadi wants to merge 1 commit into
nullclaw:mainfrom
addadi:feat/runs-observability-api
Open

feat(runs): GET /runs, GET /runs/{id}, POST /runs/{id}/cancel#10
addadi wants to merge 1 commit into
nullclaw:mainfrom
addadi:feat/runs-observability-api

Conversation

@addadi

@addadi addadi commented Aug 22, 2026

Copy link
Copy Markdown

Fixes #7

Run observability + cancellation API:

  • GET /runsagent_id/status filters, 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; running → cancellation_requested event appended (status unchanged, executor polls events then transitions); terminal → already_terminal; unknown → 404. Admin token required (not lease-gated)
  • store: getRun/listRuns/cancelRun (tx-safe; not_found rolls back), CancelOutcome
  • openapi.json: new paths
  • tests: 5 store + 4 api unit tests; e2e section 7.1

Note: the unit tests execute once #9 (test wiring) merges; branch kept independent of it. E2e verified locally: 116 passed, 0 failed.

- GET /runs/{id}: single run fetch incl usage_json + error_text; 404 unknown
- GET /runs: agent_id/status filters, limit 1..1000 (default 50), newest-first
- 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).
- store: getRun/listRuns/cancelRun (tx-safe; not_found rolls back), CancelOutcome
- openapi: /runs, /runs/{id}, /runs/{id}/cancel paths
- tests: 5 store + 4 api unit tests; e2e section 7.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant