feat(core): fully reset in-review → todo so the task starts over

Previously this transition cleared only transient execution state
(status/error/worktree/blockedBy/workflowStepResults), but kept the
prior branch, baseBranch, baseCommitSha, summary, and recovery
counters. That meant retrying a reviewed task resumed on the old
branch with a stale summary instead of starting fresh. Now those
fields are also cleared on in-review → todo. Other reopen paths
(in-progress/done → todo/triage) keep their existing behavior.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
gsxdsm
2026-04-28 16:21:56 -07:00
parent 4763a3cf8b
commit 3cf07fa413
2 changed files with 25 additions and 0 deletions

View File

@@ -2615,6 +2615,17 @@ export class TaskStore extends EventEmitter<TaskStoreEvents> {
task.workflowStepResults = undefined;
}
// Full reset when sending an in-review task back to todo: discard prior
// branch/summary/recovery state so the next run starts from scratch.
if (fromColumn === "in-review" && toColumn === "todo") {
task.branch = undefined;
task.baseBranch = undefined;
task.baseCommitSha = undefined;
task.summary = undefined;
task.recoveryRetryCount = undefined;
task.nextRecoveryAt = undefined;
}
await this.atomicWriteTaskJson(dir, task);
// Update cache if watcher is active