fix: skip blocked todo tasks during self-owned reclaim
This commit is contained in:
5
.changeset/blocked-todo-reclaim.md
Normal file
5
.changeset/blocked-todo-reclaim.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@runfusion/fusion": patch
|
||||
---
|
||||
|
||||
Skip self-owned branch reclaim for dependency-blocked todo tasks so repaired queued work is not repeatedly resumed before its blocker clears.
|
||||
@@ -7722,6 +7722,20 @@ describe("SelfHealingManager reclaimSelfOwnedBranchConflicts", () => {
|
||||
expect(store.updateTask).toHaveBeenCalledWith("FN-500", expect.objectContaining({ worktree: "/tmp/fn-500", branch: "fusion/fn-500", status: null, paused: false }));
|
||||
});
|
||||
|
||||
it("skips blocked todo tasks with preserved branches", async () => {
|
||||
(store.listTasks as any)
|
||||
.mockResolvedValueOnce([{ id: "FN-516", column: "todo", blockedBy: "FN-216", checkedOutBy: null, branch: "fusion/fn-516", worktree: "/tmp/fn-516" }])
|
||||
.mockResolvedValueOnce([])
|
||||
.mockResolvedValueOnce([]);
|
||||
const inspectSpy = vi.spyOn(branchConflictModule, "inspectBranchConflict");
|
||||
|
||||
const recovered = await manager.reclaimSelfOwnedBranchConflicts();
|
||||
|
||||
expect(recovered).toBe(0);
|
||||
expect(inspectSpy).not.toHaveBeenCalled();
|
||||
expect(store.updateTask).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("skips checked out tasks", async () => {
|
||||
(store.listTasks as any)
|
||||
.mockResolvedValueOnce([{ id: "FN-501", checkedOutBy: "agent-1", branch: "fusion/fn-501", worktree: "/tmp/fn-501" }])
|
||||
|
||||
@@ -2083,6 +2083,10 @@ export class SelfHealingManager {
|
||||
for (const task of candidates) {
|
||||
if (task.checkedOutBy || activeTaskIds.has(task.id.toUpperCase()) || !task.branch || !task.worktree) continue;
|
||||
if (task.userPaused) continue;
|
||||
if (task.column === "todo" && task.blockedBy) {
|
||||
log.log(`[self-healing] skipping blocked todo task ${task.id} during self-owned branch reclaim (blockedBy=${task.blockedBy})`);
|
||||
continue;
|
||||
}
|
||||
if (task.pausedReason === "worktrunk_operation_failed") {
|
||||
log.log(`[self-healing] skipping worktrunk-paused task ${task.id}`);
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user