{"record":{"id":"eae1db228c37f645","repo":"coleam00/Archon","slug":"could-not-verify-uncommitted-changes-worktree-pat","errorCode":null,"errorMessage":"could not verify uncommitted changes (worktree path may be missing)","messagePattern":"could not verify uncommitted changes \\(worktree path may be missing\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/cli/src/commands/isolation.ts","lineNumber":279,"sourceCode":"      notFound++;\n      continue;\n    }\n\n    // Run all safety checks before removing — collect all blockers, report at once.\n    // Skipped entirely when --force is set.\n    if (!options.force) {\n      const blockers: string[] = [];\n\n      // Check 1: uncommitted changes in worktree\n      try {\n        const hasChanges = await hasUncommittedChanges(toWorktreePath(env.working_path));\n        if (hasChanges) {\n          blockers.push('uncommitted changes in worktree');\n        }\n      } catch (error) {\n        getLog().warn(\n          { err: error as Error, branch },\n          'isolation.complete_uncommitted_check_failed'\n        );\n        blockers.push('could not verify uncommitted changes (worktree path may be missing)');\n      }\n\n      // Check 2: running workflow on this branch\n      try {\n        const activeRun = await workflowDb.getActiveWorkflowRunByPath(env.working_path);\n        if (activeRun) {\n          blockers.push(`running workflow: ${activeRun.workflow_name} (id: ${activeRun.id})`);\n        }\n      } catch (error) {\n        getLog().warn({ err: error as Error, branch }, 'isolation.complete_workflow_check_failed');\n        console.warn('  Warning: could not check for running workflows — skipping workflow check');\n      }\n\n      // Check 3: open PRs on this branch (requires gh CLI)\n      try {\n        const ghResult = await execFileAsync(","sourceCodeStart":261,"sourceCodeEnd":297,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/cli/src/commands/isolation.ts#L261-L297","documentation":"isolationCompleteCommand adds this blocker when the pre-completion check for uncommitted changes cannot run — typically because the worktree path is missing so the git status command fails. Completion is deliberately blocked (fail-safe) rather than proceeding with unknown worktree state; the underlying error is logged as 'isolation.complete_uncommitted_check_failed'.","triggerScenarios":"Running `archon isolation complete` when the git status probe inside the worktree throws — working_path was deleted or moved, path permissions deny access, the branch/repo metadata is gone, or git itself fails in the checkout.","commonSituations":"Manual deletion or relocation of the worktree before completing; a crashed run left the checkout half-removed; the codebase lives on an unmounted volume; disk cleanup removed the directory while the run was still marked active.","solutions":["Restore the worktree (re-create/checkout the branch) or unmount/remount the volume so the path exists, then re-run complete","If the work is genuinely gone and should not be preserved, cancel/abandon the isolation instead of forcing completion so state stays truthful","Check the 'isolation.complete_uncommitted_check_failed' log for the exact git/FS error to distinguish a missing path from a permissions problem","Commit any remaining changes in the worktree first, then re-run `archon isolation complete` — the blocker clears once the check can run"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// verify worktree path before attempting completion\nif (!existsSync(env.working_path)) {\n  throw new Error(`worktree missing: ${env.working_path}; restore it or cancel the isolation`);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await checkUncommitted(worktreePath);\n} catch (err) {\n  getLog().warn({ err, branch }, 'isolation.complete_uncommitted_check_failed');\n  blockers.push('could not verify uncommitted changes (worktree path may be missing)');\n}","preventionTips":["Never delete or move an active worktree directory manually","Complete or cancel isolations before host cleanup/volume unmounts","Inspect 'isolation.complete_uncommitted_check_failed' logs for exact cause","Commit work in the worktree before calling complete so the check passes cleanly"],"tags":["cli","git-worktree","isolation","fail-safe"],"backgroundTag":"worktree-status-check-failed","analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}