Runs can be cancelled from the API and the dashboard #2088

Closed
opened 2026-11-21 06:36:28 +00:00 by sam · 2 comments
Owner

runs.Engine.Cancel has no caller: no API route or dashboard action reaches it. An operator can't stop a run, and the cascade added in #2086 (cancelling a run cancels the runs it started with workflow.call) is unreachable.

Done when

  • POST /api/runs/{id}/cancel cancels a run and the runs it called, and returns the run.
  • The run page has a Cancel action for a run that hasn't ended.
  • Cancelling a run that has already ended is refused with a clear error.
  • On staging, cancelling a parent waiting on a workflow.call child cancels both.
`runs.Engine.Cancel` has no caller: no API route or dashboard action reaches it. An operator can't stop a run, and the cascade added in #2086 (cancelling a run cancels the runs it started with `workflow.call`) is unreachable. ## Done when - `POST /api/runs/{id}/cancel` cancels a run and the runs it called, and returns the run. - The run page has a Cancel action for a run that hasn't ended. - Cancelling a run that has already ended is refused with a clear error. - On staging, cancelling a parent waiting on a `workflow.call` child cancels both.
sam added the highbug labels 2026-11-21 06:36:28 +00:00
sam added the in-progress label 2026-11-21 07:21:47 +00:00
Author
Owner

Landed in d318f912a.

  • POST /api/runs/{id}/cancel reaches runs.Engine.Cancel, cancels the run and the runs it started with workflow.call (the #2086 cascade), and returns the run as a RunView.
  • Store.Cancel is now org-scoped and guards inside the transaction: no such run -> 404, already ended (succeeded/failed/cancelled/declined) -> 409 "the run has already ended, so there is nothing to cancel". Already-ended descendants are still left alone.
  • The run page (/runs/:id) shows a destructive Cancel action while the run's state is not terminal; a refusal from the API is shown inline.
  • api/openapi.yaml regenerated; task check passes (go tests, golangci-lint, ui typecheck + 127 tests, openapi/proto/db checks).

Remaining done-when item: on staging, cancelling a parent waiting on a workflow.call child cancels both.

Landed in d318f912a. - `POST /api/runs/{id}/cancel` reaches `runs.Engine.Cancel`, cancels the run and the runs it started with `workflow.call` (the #2086 cascade), and returns the run as a `RunView`. - `Store.Cancel` is now org-scoped and guards inside the transaction: no such run -> 404, already ended (succeeded/failed/cancelled/declined) -> 409 "the run has already ended, so there is nothing to cancel". Already-ended descendants are still left alone. - The run page (`/runs/:id`) shows a destructive Cancel action while the run's state is not terminal; a refusal from the API is shown inline. - `api/openapi.yaml` regenerated; `task check` passes (go tests, golangci-lint, ui typecheck + 127 tests, openapi/proto/db checks). Remaining done-when item: on staging, cancelling a parent waiting on a `workflow.call` child cancels both.
Author
Owner

Landed in d318f912a. Closing without the manual check; it moves to #2096.

Landed in d318f912a. Closing without the manual check; it moves to #2096.
sam closed this issue 2026-11-21 15:01:52 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#2088