coleam00/Archon · error · Error

Cannot resume: the working path from the run no longer exist

Error message

Cannot resume: the working path from the run no longer exists: ${resumable.working_path}
The worktree may have been cleaned up. Start a fresh run with --branch instead.

What it means

During --resume, the CLI reuses the prior run's working_path (its worktree) instead of cutting a new one. If that path no longer exists on disk — typically because the worktree was pruned by `git worktree remove`, a cleanup job, or manual deletion — resuming would silently run against a wrong/fresh directory, so the CLI fails with this message and points to starting a fresh --branch run instead.

Source

Thrown at packages/cli/src/commands/workflow.ts:2407

    getLog().info(
      {
        workflowRunId: resumable.id,
        workflowName,
        workingPath: resumable.working_path,
      },
      'workflow.resume_found_resumable'
    );

    // A container run IS resumable (Phase C): the overlay lives on a persisted
    // volume the resume rediscovers and restarts (see the folder branch below,
    // which calls backend.resumeEnv when `resumable.metadata.isolation` is
    // 'container'). Nothing to reject here anymore.

    // Reuse the working path from the resumable run (verify it still exists)
    if (resumable.working_path) {
      const { existsSync } = await import('fs');
      if (!existsSync(resumable.working_path)) {
        throw new Error(
          `Cannot resume: the working path from the run no longer exists: ${resumable.working_path}\n` +
            'The worktree may have been cleaned up. Start a fresh run with --branch instead.'
        );
      }
      workingCwd = resumable.working_path;
    }

    // Look up the isolation environment that owns this working path (if any)
    const allEnvs = await isolationDb.listByCodebase(codebase.id);
    const matchingEnv = allEnvs.find(e => e.working_path === workingCwd);
    if (matchingEnv) {
      isolationEnvId = matchingEnv.id;
      getLog().info(
        { envId: isolationEnvId, workingPath: workingCwd },
        'workflow.resume_env_found'
      );
    }

View on GitHub (pinned to 0773b97458)

Solutions

  1. Check if the worktree is recoverable: `git worktree list` and re-add it at the same path if the branch still exists.
  2. If the branch survives, run `git worktree add <path> <branch>` to restore it, then resume again.
  3. Otherwise start a fresh run with --branch (as the message advises) and re-apply any uncommitted work manually.
  4. Verify the run's working_path in `archon workflow get <id>` matches a real directory before resuming.

Example fix

// before
archon workflow run my-flow --resume  # working path no longer exists: /repo/.archon/worktrees/my-flow-123
// after
git worktree add /repo/.archon/worktrees/my-flow-123 my-flow-123
archon workflow run my-flow --resume
Defensive patterns

Strategy: validation

Validate before calling

import { existsSync } from 'fs';
// fetch the resumable run first, then check its working_path
const run = await workflowDb.getWorkflowRun(id);
if (run?.working_path && !existsSync(run.working_path)) {
  console.error(`Worktree ${run.working_path} is gone; re-add it or start fresh with --branch.`);
}

Type guard

function hasLiveWorkingPath(r: { working_path: string | null }): r is { working_path: string } {
  return typeof r.working_path === 'string' && existsSync(r.working_path);
}

Try / catch

try {
  await runWorkflow({ resume: true });
} catch (error) {
  if ((error as Error).message.includes('working path from the run no longer exists')) {
    const path = /no longer exists: (\S+)/.exec((error as Error).message)?.[1];
    console.error(`Restore the worktree at ${path} via 'git worktree add', or start fresh with --branch.`);
  } else throw error;
}

Prevention

When it happens

Trigger: Running `archon workflow run <flow> --resume` where the resumable run row has a working_path and existsSync(working_path) returns false: worktree cleaned up, disk path moved, run originated on another machine/container whose paths do not exist locally.

Common situations: Running `git worktree prune` or a repo cleanup between attempts; deleting .archon worktrees to free space; resuming a run recorded on a different host with different absolute paths.

Related errors


AI-assisted analysis of coleam00/Archon@0773b97458 (2026-09-01). Data as JSON: /api/errors/d95f2072cdcf4866. Report an issue: GitHub.