From 0336a121b5f16c24623547d517a4a92591083bfc Mon Sep 17 00:00:00 2001 From: Rassl Date: Tue, 1 Sep 2026 22:36:49 +0400 Subject: [PATCH] feat: admin UI opts into run cancellation on approve/dismiss MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The backend no longer cancels a review's in-flight human-review workflow by default (a workflow deciding its own review was killing itself). The admin UI keeps the old semantics by sending cancel_active_runs: true — a human deciding here makes the running workflow moot. Claude-Session: https://claude.ai/code/session_01H4kh4H4Keukz8r7XyG6TtE --- src/lib/graph-api.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/lib/graph-api.ts b/src/lib/graph-api.ts index bead31a..3e3154f 100644 --- a/src/lib/graph-api.ts +++ b/src/lib/graph-api.ts @@ -1175,7 +1175,11 @@ export async function approveReview( } return { status: "Success", review } } - const body = overridePayload ? { override_payload: overridePayload } : {} + // cancel_active_runs: an admin deciding here makes any in-flight + // human-review workflow moot, so ask the backend to stop it. Workflows + // deciding their own reviews omit this — cancelling would kill their run. + const body: Record = { cancel_active_runs: true } + if (overridePayload) body.override_payload = overridePayload return api.post( `/v2/reviews/${refId}/approve`, body, @@ -1200,9 +1204,10 @@ export async function dismissReview( } return { status: "Success", review } } + // cancel_active_runs: same admin-decided semantics as approveReview above. return api.post( `/v2/reviews/${refId}/dismiss`, - { reason }, + { reason, cancel_active_runs: true }, undefined, signal )