{"record":{"id":"8b8cdf1fc9c761f7","repo":"coleam00/Archon","slug":"failed-to-resolve-and-cancel-approval-gate-err","errorCode":null,"errorMessage":"Failed to resolve and cancel approval gate: ${err.message}","messagePattern":"Failed to resolve and cancel approval gate: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/core/src/db/workflows.ts","lineNumber":332,"sourceCode":"      );\n      const resolved = (result.rowCount ?? 0) > 0;\n      if (resolved) {\n        for (const event of events) {\n          await insertWorkflowEvent(query, { workflow_run_id: id, ...event });\n        }\n        await insertWorkflowEvent(query, {\n          workflow_run_id: id,\n          event_type: 'workflow_cancelled',\n          step_name: cancellation.step_name,\n          data: cancellation.reason === undefined ? undefined : { reason: cancellation.reason },\n        });\n      }\n      return { resolved };\n    });\n  } catch (error) {\n    const err = error as Error;\n    getLog().error({ err, workflowRunId: id }, 'db.workflow_run_resolve_cancel_gate_failed');\n    throw new Error(`Failed to resolve and cancel approval gate: ${err.message}`);\n  }\n}\n\n/**\n * Thrown by resumeWorkflowRun when the target run is no longer in a resumable\n * state (already running/terminal, or concurrently resumed). Callers translate\n * this into a user-facing \"already being resumed\" message instead of leaking\n * the raw internal error string.\n */\nexport class WorkflowNotResumableError extends Error {\n  constructor(\n    public readonly runId: string,\n    public readonly currentStatus: string\n  ) {\n    super(\n      `Workflow run is not resumable (id: ${runId}, status: ${currentStatus}). ` +\n        'It may have already been resumed, completed, or cancelled.'\n    );","sourceCodeStart":314,"sourceCodeEnd":350,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/core/src/db/workflows.ts#L314-L350","documentation":"Error \"Failed to resolve and cancel approval gate: ${err.message}\" thrown in coleam00/Archon.","triggerScenarios":"Thrown at packages/core/src/db/workflows.ts:332 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}