{"record":{"id":"036ea235fd510696","repo":"coleam00/Archon","slug":"cannot-resume-the-prior-run-for-workflowname","errorCode":null,"errorMessage":"Cannot resume: the prior run for '${workflowName}' has no completed nodes and no interactive-loop state.","messagePattern":"Cannot resume: the prior run for '(.+?)' has no completed nodes and no interactive-loop state\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/commands/workflow.ts","lineNumber":2973,"sourceCode":"  // The lookup-by-(workflowName, cwd) was already done above for worktree-path\n  // resolution; reuse that result rather than querying twice.\n  const deps = createWorkflowDeps();\n  let prepared: Awaited<ReturnType<typeof hydrateResumableRun>> = null;\n  if (options.resume && resumable) {\n    try {\n      prepared = await hydrateResumableRun(deps, resumable);\n    } catch (error) {\n      const err = error as Error;\n      getLog().error(\n        { err, workflowName, runId: resumable.id },\n        'cli.workflow_hydrate_resume_failed'\n      );\n      throw new Error(\n        `Cannot resume workflow '${workflowName}': failed to load prior run state — ${err.message}`\n      );\n    }\n    if (!prepared) {\n      throw new Error(\n        `Cannot resume: the prior run for '${workflowName}' has no completed nodes and no interactive-loop state.`\n      );\n    }\n  }\n\n  // Execute workflow with workingCwd (may be worktree path). `undefined` until\n  // assigned so the finally-block teardown can tell \"threw before a result\" from\n  // a real terminal/paused result.\n  let result: Awaited<ReturnType<typeof executeWorkflow>> | undefined;\n  // A genuine container-teardown failure captured in the finally, rethrown AFTER\n  // the finally when the run itself succeeded — so a leaked privileged container\n  // fails the CLI instead of reporting success + exit 0.\n  let containerTeardownError: Error | undefined;\n  // Container run context for the engine (Phase C): the write-back backend port +\n  // env id + policy. The executor drives suspend-on-pause and the write-back gate\n  // through this. Absent for host/in-place runs.\n  const containerRunCtx =\n    containerBackend && containerEnvId","sourceCodeStart":2955,"sourceCodeEnd":2991,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/cli/src/commands/workflow.ts#L2955-L2991","documentation":"After loading prior run state, resume requires either completed nodes or interactive-loop state to reconstruct execution; if hydration succeeds but produces nothing resumable, the CLI refuses with this explanatory error rather than silently restarting or crashing later.","triggerScenarios":"`archon workflow <name> --resume` targeting a run whose stored state has zero completed nodes and no interactive-loop checkpoint — the run failed or was cancelled before the first node finished, or state was cleared.","commonSituations":"Resuming a run that crashed during setup; a run cancelled immediately after creation; state pruned by cleanup; selecting the wrong run ID from `workflow list`.","solutions":["Start a new run of the workflow — there is no prior progress to restore.","Verify you are resuming the intended run (`archon workflow list --verbose`), not an empty/aborted one.","If you expect completed nodes, check whether another process cleaned or rewrote the run state.","Ensure no ambiguous owner (lock files) caused the state to be discarded."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// confirm the run actually has progress before resuming\nconst runs = await getWorkflowStatus();\nconst target = runs.runs.find(r => r.id === resumable.id);\nif (!target || (target.completedCount ?? 0) === 0) {\n  throw new Error('Nothing to resume; start a fresh run');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only resume runs shown as having completed nodes in `archon workflow list --verbose`.","Do not cancel runs immediately after creation if you intend to resume them.","Start a fresh run when a run failed before its first node completed.","Check retention/cleanup settings that may prune run state."],"tags":["resume","state","cli"],"backgroundTag":"resume-state-load-failed","analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}