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 )