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: task folder may live in a different repo than
768
- // the lane's worktree. Always use the absolute canonical path
769
- // .DONE and STATUS.md are written by workers to the original
770
- // task folder (via absolute TASK_AUTOSTART path), not to the worktree.
771
- resolvedFolder = resolve(taskFolder);
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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taskplane",
3
- "version": "0.21.4",
3
+ "version": "0.21.5",
4
4
  "description": "AI agent orchestration for pi — parallel task execution with checkpoint discipline",
5
5
  "keywords": [
6
6
  "pi-package",