fix(HAI-047): resolve const reassignment and undeclared variable in executor.ts

- Change isResume from const to let to allow reassignment in fallback branch
- Remove reference to undeclared variable isReuse
This commit is contained in:
Dustin Byrne
2026-03-25 23:19:06 -04:00
parent 30f6e902cb
commit 539c1c6af9

View File

@@ -244,7 +244,7 @@ export class TaskExecutor {
// Create or reuse worktree — try pool first when recycling is enabled
const branchName = `hai/${task.id.toLowerCase()}`;
let worktreePath = task.worktree || join(this.rootDir, ".worktrees", task.id);
const isResume = existsSync(worktreePath);
let isResume = existsSync(worktreePath);
let acquiredFromPool = false;
if (!isResume) {
@@ -287,7 +287,6 @@ export class TaskExecutor {
} else {
worktreePath = task.worktree || join(this.rootDir, ".worktrees", generateWorktreeName(this.rootDir));
isResume = existsSync(worktreePath);
isReuse = false;
this.createWorktree(branchName, worktreePath);
}