{"record":{"id":"9d0703c8e424c386","repo":"coleam00/Archon","slug":"response-recorded-but-failed-to-resume-workflow","errorCode":null,"errorMessage":"Response recorded but failed to resume workflow '${result.workflowName}': ${err.message}\nThe response was recorded. Run 'bun run cli workflow resume ${resolvedId}' to retry.","messagePattern":"Response recorded but failed to resume workflow '(.+?)': (.+?)\nThe response was recorded\\. Run 'bun run cli workflow resume (.+?)' to retry\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cli/src/commands/workflow.ts","lineNumber":4866,"sourceCode":"    const discoveryCwd = result.codebaseId\n      ? await resolveDiscoveryCwdForCodebase(resolvedId, result.codebaseId, 'respond')\n      : undefined;\n\n    await workflowRunCommand(result.workingPath, result.workflowName, result.userMessage ?? '', {\n      // Continue from the source this run froze, not a fresh capture of the target.\n      continuationRun: (await workflowDb.getWorkflowRun(resolvedId)) ?? undefined,\n      resume: true,\n      codebaseId: result.codebaseId ?? undefined,\n      conversationId: platformConversationId,\n      discoveryCwd,\n    });\n  } catch (error) {\n    const err = error as Error;\n    getLog().error(\n      { err, runId: resolvedId, workflowName: result.workflowName },\n      'cli.workflow_respond_resume_failed'\n    );\n    throw new Error(\n      `Response recorded but failed to resume workflow '${result.workflowName}': ${err.message}\\n` +\n        `The response was recorded. Run 'bun run cli workflow resume ${resolvedId}' to retry.`,\n      { cause: err }\n    );\n  }\n}\n\n/**\n * Reset persisted per-node provider sessions for a workflow.\n *\n * Filter rules:\n *   - workflow-name required (positional)\n *   - --scope <key>: restrict to one scope (e.g. a conversation UUID); when\n *     omitted, deletes across ALL scopes (use --yes to skip the confirmation)\n *   - --node <id>: restrict to one node within the scope\n *   - --json: machine-readable output\n */\nexport async function workflowResetSessionsCommand(","sourceCodeStart":4848,"sourceCodeEnd":4884,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/cli/src/commands/workflow.ts#L4848-L4884","documentation":"The response (approve/reject-style decision) was recorded, but the automatic resume that follows threw an error. The CLI logs `cli.workflow_respond_resume_failed`, preserves the original error as `cause`, and provides the exact resume command so the operator knows the decision does not need to be re-submitted.","triggerScenarios":"`workflow respond <id> <decision>` where the decision persists but resume fails: workspace directory missing or unwritable, child process spawn failure, run concurrently terminated elsewhere, or transient database/storage error.","commonSituations":"Workspaces reaped by cleanup jobs while awaiting the gate; container removed between decision and resume; duplicate concurrent responses; permission drift on the checkout directory.","solutions":["Run `bun run cli workflow resume <resolvedId>` as directed by the message.","Inspect the `cause` and `cli.workflow_respond_resume_failed` log entry for the root failure.","Restore/recreate the working directory (and permissions) before retrying.","Check the run state — if already terminal via another actor, no retry is required."],"exampleFix":"// before\ncatch (error) { throw error; } // operator can't tell if response recorded\n// after\ncatch (error) {\n  getLog().error({ err: error, runId: resolvedId }, 'cli.workflow_respond_resume_failed');\n  throw new Error(`Response recorded but failed to resume: ${(error as Error).message}\\nRun 'bun run cli workflow resume ${resolvedId}' to retry.`, { cause: error });\n}","handlingStrategy":"retry","validationCode":"const stat = await fs.promises.stat(run.working_path).catch(() => null);\nif (!stat?.isDirectory()) throw new Error(`Workspace ${run.working_path} missing; restore before responding.`);","typeGuard":"null","tryCatchPattern":"try {\n  await respondToWorkflow(resolvedId, decision, text);\n  await resumeWorkflow(resolvedId);\n} catch (err) {\n  getLog().error({ err, runId: resolvedId }, 'cli.workflow_respond_resume_failed');\n  console.error(`Response recorded. Retry with: bun run cli workflow resume ${resolvedId}`);\n  process.exitCode = 1;\n}","preventionTips":["Use `workflow resume <id>` to retry — never resubmit the decision","Read the wrapped `cause` to find the true failure","Guard gate-awaiting workspaces from cleanup tooling","Check for concurrent actors before retrying the resume"],"tags":["cli","workflow","resume","filesystem"],"backgroundTag":"resume-after-gate-failed","analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}