fix: reserve and clear task worktrees correctly

This commit is contained in:
gsxdsm
2026-04-05 20:56:58 -07:00
parent 97eecb1b65
commit fc47b6eb01
8 changed files with 207 additions and 23 deletions

View File

@@ -701,10 +701,10 @@ describe("POST /tasks/:id/retry", () => {
expect(res.status).toBe(200);
expect(store.updateTask).toHaveBeenCalledWith("KB-001", {
status: undefined,
error: undefined,
worktree: undefined,
branch: undefined,
status: null,
error: null,
worktree: null,
branch: null,
});
expect(store.moveTask).toHaveBeenCalledWith("KB-001", "todo");
});
@@ -734,10 +734,10 @@ describe("POST /tasks/:id/retry", () => {
expect(res.status).toBe(200);
expect(store.updateTask).toHaveBeenCalledWith("KB-001", {
status: undefined,
error: undefined,
worktree: undefined,
branch: undefined,
status: null,
error: null,
worktree: null,
branch: null,
});
expect(store.moveTask).toHaveBeenCalledWith("KB-001", "todo");
});
@@ -755,10 +755,10 @@ describe("POST /tasks/:id/retry", () => {
expect(res.status).toBe(200);
expect(store.updateTask).toHaveBeenCalledWith("KB-001", {
status: undefined,
error: undefined,
worktree: undefined,
branch: undefined,
status: null,
error: null,
worktree: null,
branch: null,
});
expect(store.moveTask).toHaveBeenCalledWith("KB-001", "todo");
expect(store.logEntry).toHaveBeenCalledWith("KB-001", "Retry requested from dashboard");

View File

@@ -1794,10 +1794,10 @@ export function createApiRoutes(store: TaskStore, options?: ServerOptions): Rout
return;
}
await scopedStore.updateTask(req.params.id, {
status: undefined,
error: undefined,
worktree: undefined,
branch: undefined,
status: null,
error: null,
worktree: null,
branch: null,
});
await scopedStore.logEntry(req.params.id, "Retry requested from dashboard");
const updated = await scopedStore.moveTask(req.params.id, "todo");