{"record":{"id":"628e2126d6b11c64","repo":"coleam00/Archon","slug":"failed-to-resume-workflow-run-workflow-name","errorCode":null,"errorMessage":"Failed to resume workflow '${run.workflow_name}': ${err.message}","messagePattern":"Failed to resume workflow '(.+?)': (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/commands/workflow.ts","lineNumber":4305,"sourceCode":"\n  // Re-execute via workflowRunCommand with --resume: it locates the prior failed\n  // run via findResumableRun and skips already-completed nodes (the executor\n  // itself no longer auto-detects resumable runs).\n  try {\n    await workflowRunCommand(run.working_path, run.workflow_name, run.user_message ?? '', {\n      // Continue from the source this run froze, not a fresh capture of the target.\n      continuationRun: run,\n      resume: true,\n      codebaseId: run.codebase_id ?? undefined,\n      discoveryCwd,\n    });\n  } catch (error) {\n    const err = error as Error;\n    getLog().error(\n      { err, runId: resolvedId, workflowName: run.workflow_name },\n      'cli.workflow_resume_run_failed'\n    );\n    throw new Error(`Failed to resume workflow '${run.workflow_name}': ${err.message}`, {\n      cause: err,\n    });\n  }\n}\n\n/**\n * Abandon a workflow run by ID (marks it as cancelled).\n *\n * `--json` emits a structured result instead of human text. In JSON mode the\n * command never throws — lookup/state errors are reported as `{ ok: false }` so\n * a parsing agent always gets one clean JSON line.\n *\n * `runId` may be the short id printed by `workflow runs` (see resolveRunIdArg).\n */\nexport async function workflowAbandonCommand(\n  runId: string,\n  json?: boolean,\n  cwd?: string","sourceCodeStart":4287,"sourceCodeEnd":4323,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/cli/src/commands/workflow.ts#L4287-L4323","documentation":"Generic wrapper thrown by the CLI's inline resume command when the underlying resume operation fails after the run was found and had a valid working path. It preserves the original error as `cause` and logs it (`cli.workflow_resume_run_failed`), surfacing `'Failed to resume workflow <name>': <original message>`.","triggerScenarios":"Any failure inside the resume flow for a valid run: filesystem errors on the working path, state-transition conflicts (run not in a resumable state), database errors, or agent/provider spawn failures during resume.","commonSituations":"Working directory deleted or moved after the run paused; the run was cancelled concurrently by another process; permission problems on the working path; DB locked by another writer.","solutions":["Read the `cause`/log entry (`cli.workflow_resume_run_failed`) for the underlying error and fix that specific issue","Verify the run's working path still exists and is writable","Check the run's current status (`archon workflow status <id>`) — only certain states can resume; cancel and restart if it is in a terminal state"],"exampleFix":"// before\ntry { await resumeWorkflowOp(id); } catch (e) { console.log(String(e)); }\n// after\ntry { await resumeWorkflowOp(id); } catch (e) { console.error('resume failed:', (e as Error).cause ?? e); }","handlingStrategy":"try-catch","validationCode":"const run = await workflowDb.getWorkflowRun(id);\nif (!run?.working_path) throw new Error('run missing or has no working path');\nif (!fs.existsSync(run.working_path)) throw new Error(`working path gone: ${run.working_path}`);","typeGuard":null,"tryCatchPattern":"try {\n  await resumeWorkflowOp(id);\n} catch (e) {\n  const cause = (e as Error & { cause?: Error }).cause ?? e;\n  console.error(`resume of ${id} failed:`, cause.message);\n}","preventionTips":["Always inspect the error's `cause` and the `cli.workflow_resume_run_failed` log line","Verify the run's working directory still exists before resuming","Avoid concurrent control commands on the same run"],"tags":["cli","workflow","resume","error-wrapping"],"backgroundTag":"workflow-resume-failed","analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}