fix(FN-009): allow task completion when worktree missing

This commit is contained in:
Fusion
2026-05-21 02:33:10 +00:00
committed by torah-worker
parent 1a5aff9c44
commit 1314a9796f

View File

@@ -5372,6 +5372,19 @@ export class TaskExecutor {
};
}
// FN-009: If worktree directory doesn't exist, skip git validation for task completion.
// This is safe because:
// 1. Task completion doesn't modify the worktree
// 2. Deliverables (task documents, follow-up tasks) are stored in fusion.db
// 3. If code changes were made, the worktree would exist
// 4. This prevents ENOENT errors when agents complete documentation/coordination tasks
if (!existsSync(worktreePath)) {
executorLog.log(
`${task.id}: worktree directory not found at ${worktreePath} — skipping git validation for task completion`,
);
return { ok: true };
}
try {
const { stdout } = await execAsync("git rev-parse --show-toplevel", {
cwd: worktreePath,