fix(pi-workflow): consume interrupted implementation recovery

This commit is contained in:
jb
2026-08-25 19:55:49 -04:00
parent a54a92ace4
commit 141fcd145f
4 changed files with 16 additions and 9 deletions
+5
View File
@@ -1611,6 +1611,11 @@ test("Recovery retry reruns failed verification after the remediation limit", as
liveStolen.revision++;
liveStolen.parentSessionIds.push("transient-session");
liveStolen.verificationEvidence!.commands[0]!.error = "stale host exception";
const interruptedImplement = liveStolen.assignments.find(
(assignment) => assignment.role === "implement",
);
assert.ok(interruptedImplement);
interruptedImplement.status = "interrupted";
liveStolen.lease = {
processId: 200,
activeParentSessionId: "transient-session",
+9 -8
View File
@@ -4348,16 +4348,17 @@ export class WorkflowEngine {
next.status = "running";
});
if (run.implementationContext?.status === "ready") {
if (interruptedMutating.length > 0) {
if (
interruptedMutating.length > 0 &&
stage(run, "implement").status !== "completed"
) {
run = await this.transition(run, (next) => {
const implement = stage(next, "implement");
if (implement.status !== "completed") {
implement.status = "completed";
implement.finishedAt = this.now();
implement.output = {
recovery: "User requested a new remediation Assignment after interruption",
};
}
implement.status = "completed";
implement.finishedAt = this.now();
implement.output = {
recovery: "User requested a new remediation Assignment after interruption",
};
});
return this.remediate(run);
}