fix(pi-workflow): consume interrupted implementation recovery
This commit is contained in:
@@ -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",
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user