feat(runs): GET /runs, GET /runs/{id}, POST /runs/{id}/cancel - #10
Open
addadi wants to merge 1 commit into
Open
Conversation
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #7
Run observability + cancellation API:
GET /runs—agent_id/statusfilters,limit1..1000 (default 50), newest-firstGET /runs/{id}— single run inclusage_json+error_text; 404 unknownPOST /runs/{id}/cancel— pending → terminalcancelled; running →cancellation_requestedevent 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),CancelOutcomeopenapi.json: new pathsNote: the unit tests execute once #9 (test wiring) merges; branch kept independent of it. E2e verified locally: 116 passed, 0 failed.