taskplane 0.21.4 → 0.21.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -764,11 +764,29 @@ export function resolveCanonicalTaskPaths(
|
|
|
764
764
|
let resolvedFolder: string;
|
|
765
765
|
|
|
766
766
|
if (isWorkspaceMode) {
|
|
767
|
-
// Workspace mode:
|
|
768
|
-
//
|
|
769
|
-
//
|
|
770
|
-
//
|
|
771
|
-
|
|
767
|
+
// Workspace mode: check both the original source path AND the
|
|
768
|
+
// worktree-relative path. The task-runner may write .DONE to either
|
|
769
|
+
// location depending on how TASK_AUTOSTART resolves in the worker's
|
|
770
|
+
// context. Check worktree first (most common), then fall back to original.
|
|
771
|
+
const candidatePaths: string[] = [];
|
|
772
|
+
|
|
773
|
+
// Candidate 1: worktree-relative (task folder mirrored in worktree)
|
|
774
|
+
if (folderNorm.startsWith(repoRootNorm + "/")) {
|
|
775
|
+
const relPath = folderNorm.slice(repoRootNorm.length + 1);
|
|
776
|
+
candidatePaths.push(join(worktreePath, relPath));
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
// Candidate 2: original absolute path
|
|
780
|
+
candidatePaths.push(resolve(taskFolder));
|
|
781
|
+
|
|
782
|
+
// Use whichever has .DONE or STATUS.md; default to first candidate
|
|
783
|
+
resolvedFolder = candidatePaths[0];
|
|
784
|
+
for (const candidate of candidatePaths) {
|
|
785
|
+
if (existsSync(join(candidate, ".DONE")) || existsSync(join(candidate, "STATUS.md"))) {
|
|
786
|
+
resolvedFolder = candidate;
|
|
787
|
+
break;
|
|
788
|
+
}
|
|
789
|
+
}
|
|
772
790
|
} else if (folderNorm.startsWith(repoRootNorm + "/")) {
|
|
773
791
|
// Repo mode: task folder is inside the repo root.
|
|
774
792
|
// Translate to equivalent path in the worktree.
|