From 70ccffa0d0f8929f74e072d7416a6e6ee6dc720d Mon Sep 17 00:00:00 2001 From: pedrofrxncx Date: Wed, 2 Sep 2026 08:05:18 -0300 Subject: [PATCH] fix(task-board): stop hardcoding 'in_progress' in the failed-run reaction MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit reactToFailedTaskRun already takes this org's board lanes as a parameter, but its retry/return-to-todo gate still compared item.status against the literal string "in_progress" instead of lanes.progress. On an org-owned board (org_board_columns) whose in-progress column is named anything else, this comparison never matches, so a failed run's card is silently never retried and never sent back to To Do — it just sits in progress forever with no failure reaction. Same class of bug as #6849 (advanceToReviewIfInProgress hardcoded in_progress/in_review). --- apps/api/src/tools/task-board/run-reactions.test.ts | 7 +++++++ apps/api/src/tools/task-board/run-reactions.ts | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/api/src/tools/task-board/run-reactions.test.ts b/apps/api/src/tools/task-board/run-reactions.test.ts index 94139a706c..26bf8a3e51 100644 --- a/apps/api/src/tools/task-board/run-reactions.test.ts +++ b/apps/api/src/tools/task-board/run-reactions.test.ts @@ -322,4 +322,11 @@ describe("reactToFailedTaskRun on a card that already moved on", () => { await reactToFailedTaskRun(taskBoard, "thr-1", "org-1", CANON_LANES); expect(calls).toEqual(["retry"]); }); + + it("retries a card mid-work on an org-owned board whose progress column isn't named 'in_progress'", async () => { + const orgLanes = { ...CANON_LANES, progress: "col-doing" }; + const { taskBoard, calls } = fakeBoard("col-doing"); + await reactToFailedTaskRun(taskBoard, "thr-1", "org-1", orgLanes); + expect(calls).toEqual(["retry"]); + }); }); diff --git a/apps/api/src/tools/task-board/run-reactions.ts b/apps/api/src/tools/task-board/run-reactions.ts index 4d30701f84..395af36413 100644 --- a/apps/api/src/tools/task-board/run-reactions.ts +++ b/apps/api/src/tools/task-board/run-reactions.ts @@ -417,7 +417,7 @@ export async function reactToFailedTaskRun( .relabelDeliveredFailure(threadId, orgId, DELIVERED_FAILURE_REASON) .catch(() => {}); } - if (item.status !== "in_progress") continue; + if (item.status !== lanes.progress) continue; // A REVIEWER's run failed, not the author's: the card is In Progress only // because that is where a card under review sits now. Retrying it here // would dispatch a fresh Super Agent run over a PR that is waiting for a