coleam00/Archon · error

unreadableGateMessage(run, attention, approval) — one of: "R

Error message

unreadableGateMessage(run, attention, approval) — one of: "Run ${run.id} has an unrecognized gate type '${String(approval?.type)}'. This Archon build cannot resolve it." | "Run ${run.id} cannot be resolved: ${attention.detail}."

What it means

assertRejectable deliberately allows rejecting runs whose gate METADATA is malformed (so operators can discard broken runs), but two cases are still fatal: an unrecognized gate 'type' from a newer/older Archon build, and an unreadable block pointer with nothing to follow. unreadableGateMessage renders the appropriate variant.

Source

Thrown at packages/core/src/operations/workflow-operations.ts:360

  const attention = runAttention(run);
  switch (attention?.kind) {
    case 'blocked_on_child':
      // Same redirect as assertApprovable: the parent's pause is not a rejectable
      // gate — cancelling the parent here would silently orphan the still-paused
      // child run. Reject the child (its own gate) or abandon the parent (which
      // cascade-cancels the subtree) instead.
      throw new Error(
        `Run ${run.id} is paused waiting on sub-run ${attention.childRunId} ` +
          `('workflow:' node '${attention.nodeId}'). Reject the child run instead` +
          `: /workflow reject ${attention.childRunId}` +
          ' To discard the whole tree, abandon this run.'
      );
    case 'unreadable':
      // The one deliberate divergence from approve: unreadable gate METADATA is
      // still rejectable (see this function's doc comment). An unrecognized gate
      // TYPE is not, and neither is a block pointer with nothing to follow.
      if (attention.reason === 'malformed_gate') break;
      throw new Error(unreadableGateMessage(run, attention, approval));
    case undefined:
      if (approval && isGateResolved(approval)) {
        throw new Error(
          `Workflow run ${run.id} was already ${String(approval.resolved)} and is awaiting resume.`
        );
      }
      break;
    case 'awaiting_response':
    case 'terminal':
      // 'terminal' is unreachable: the status guard above already returned for it.
      break;
  }
  return approval;
}

// ---------------------------------------------------------------------------
// Operations
// ---------------------------------------------------------------------------

View on GitHub (pinned to 0773b97458)

Solutions

  1. Upgrade (or align) the Archon binary to the version that wrote the gate type so it can resolve the approval.
  2. If the run should simply be discarded, use abandonWorkflow instead of reject — it does not require a readable gate.
  3. Inspect run.metadata.approval to see the unrecognized 'type' value and confirm which build produced it.
  4. Recover the run from a backup or re-run the workflow if metadata is corrupt.

Example fix

// before
await workflowRejectCommand({ runId }); // throws on unrecognized gate type
// after
const type = run.metadata?.approval?.type;
if (type === 'approval') {
  await workflowRejectCommand({ runId });
} else {
  await abandonWorkflow(runId); // discard unresolvable gate
}
Defensive patterns

Strategy: type-guard

Validate before calling

const KNOWN_TYPES = ['approval'];
const t = run.metadata?.approval?.type;
if (t && !KNOWN_TYPES.includes(t)) console.warn(`Unknown gate type ${t}; abandon instead`);

Type guard

function hasKnownGateType(a: unknown): a is { type: string } {
  return !!a && typeof a === 'object' && typeof (a as any).type === 'string' && (a as any).type === 'approval';
}

Try / catch

try { await workflowRejectCommand({ runId }); }
catch (e) {
  if ((e as Error).message.includes("unrecognized gate type")) {
    await abandonWorkflow(runId); // discard unresolvable gate
  } else throw e;
}

Prevention

When it happens

Trigger: Rejecting a paused run whose approval metadata has attention.reason other than 'malformed_gate' — either approval.type is not recognized by this build, or the block pointer is unreadable/unfollowable.

Common situations: A database written by a newer Archon version carries a gate type this binary does not know (downgrade or mixed-version deployment); approval metadata was corrupted or hand-edited; a partially-written block pointer leaves no resolvable target.

Related errors


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