Merge pull request #1142 from plarson/fix/pending-review-not-failed
fix(engine): do not fail tasks parked for pending review
This commit is contained in:
@@ -241,7 +241,7 @@ describe("Workflow Steps Execution", () => {
|
||||
await executor.execute(baseTask as any);
|
||||
|
||||
expect(mockedCreateFnAgent).toHaveBeenCalledTimes(1);
|
||||
expect(store.updateTask).toHaveBeenCalledWith("FN-5436-A", {
|
||||
expect(store.updateTask).not.toHaveBeenCalledWith("FN-5436-A", {
|
||||
status: "failed",
|
||||
error: "executor-exit-while-review-pending",
|
||||
});
|
||||
@@ -253,7 +253,7 @@ describe("Workflow Steps Execution", () => {
|
||||
undefined,
|
||||
expect.objectContaining({ agentId: "executor" }),
|
||||
);
|
||||
expect(onError).toHaveBeenCalledWith(
|
||||
expect(onError).not.toHaveBeenCalledWith(
|
||||
expect.objectContaining({ id: "FN-5436-A" }),
|
||||
expect.objectContaining({ message: "executor-exit-while-review-pending" }),
|
||||
);
|
||||
@@ -291,7 +291,7 @@ describe("Workflow Steps Execution", () => {
|
||||
await executor.execute(baseTask as any);
|
||||
|
||||
expect(mockedCreateFnAgent).toHaveBeenCalledTimes(1);
|
||||
expect(store.updateTask).toHaveBeenCalledWith("FN-5436-B", {
|
||||
expect(store.updateTask).not.toHaveBeenCalledWith("FN-5436-B", {
|
||||
status: "failed",
|
||||
error: "executor-exit-while-review-pending",
|
||||
});
|
||||
|
||||
@@ -85,7 +85,7 @@ describe("reliability interactions: FN-5436 executor pending-review skip", () =>
|
||||
const executor = new TaskExecutor(store as any, "/repo");
|
||||
await executor.execute(task);
|
||||
|
||||
expect(store.updateTask).toHaveBeenCalledWith("FN-5436-RI-C", {
|
||||
expect(store.updateTask).not.toHaveBeenCalledWith("FN-5436-RI-C", {
|
||||
status: "failed",
|
||||
error: "executor-exit-while-review-pending",
|
||||
});
|
||||
|
||||
@@ -4536,12 +4536,12 @@ export class TaskExecutor {
|
||||
this.tokenUsageBaselines.delete(task.id);
|
||||
session.dispose();
|
||||
await this.persistTokenUsage(task.id);
|
||||
await this.store.updateTask(task.id, {
|
||||
status: "failed",
|
||||
error: "executor-exit-while-review-pending",
|
||||
});
|
||||
// A pending-review block is not an execution failure. The executor
|
||||
// cannot continue until the reviewer decision is resolved, so park
|
||||
// the task in review without setting status=failed; otherwise the
|
||||
// merge/review queue deadlocks on a task that is both in-review and
|
||||
// failed.
|
||||
await this.handoffTaskToReview(task, "executor-exit-while-review-pending");
|
||||
this.options.onError?.(task, new Error("executor-exit-while-review-pending"));
|
||||
pendingReviewParked = true;
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user