fix(approvals): a REJECTED decision must not satisfy the stage approval gate on retry

This commit is contained in:
2026-07-12 13:08:42 +04:00
parent 8c45650e21
commit 1fd878eb9b
2 changed files with 70 additions and 2 deletions
@@ -661,8 +661,11 @@ class DefaultSessionOrchestrator(
.map { it.requestId }
.toSet()
stageRequestIds.isNotEmpty() && events.any {
(it.payload as? ApprovalDecisionResolvedEvent)
?.requestId in stageRequestIds
val decision = it.payload as? ApprovalDecisionResolvedEvent
// A REJECTED decision must NOT satisfy the gate on retry/resume, else the stage
// runs unapproved. Only APPROVED/AUTO_APPROVED count as a prior approval.
decision?.requestId in stageRequestIds &&
decision?.outcome != ApprovalOutcome.REJECTED
}
}
if (!alreadyApproved) {