coleam00/Archon · error · Error

Model binding '${bindingName}' has an invalid effort.

Error message

Model binding '${bindingName}' has an invalid effort.

What it means

readRunModelBindingsMetadata validates a run's model_bindings metadata with runModelBindingsMetadataSchema. When validation fails and the first issue path contains 'effort', it throws this error naming the binding whose reasoning-effort value is invalid. Invalid persisted effort values cannot be mapped onto a provider call, so execution stops early with a clear message.

Source

Thrown at packages/workflows/src/model-validation.ts:504

    },
  };
}

/** Read metadata written by this module; malformed external JSON fails explicitly. */
export function readRunModelBindingsMetadata(
  metadata: Record<string, unknown> | undefined
): RunModelBindingsMetadata | undefined {
  const value = metadata?.[RUN_MODEL_BINDINGS_METADATA_KEY];
  if (value === undefined) return undefined;
  const parsed = runModelBindingsMetadataSchema.safeParse(value);
  if (!parsed.success) {
    const path = parsed.error.issues[0]?.path ?? [];
    const bindingName = typeof path[2] === 'string' ? path[2] : 'unknown';
    if (path.includes('thinking')) {
      throw new Error(`Model binding '${bindingName}' has invalid thinking options.`);
    }
    if (path.includes('effort')) {
      throw new Error(`Model binding '${bindingName}' has an invalid effort.`);
    }
    if (path[0] === 'overrides' && (path[1] === 'tiers' || path[1] === 'aliases')) {
      throw new Error(`Workflow run has invalid model_bindings ${path[1]} metadata.`);
    }
    if (path[0] === 'effective') {
      throw new Error('Workflow run has invalid effective model bindings.');
    }
    throw new Error('Workflow run has invalid model_bindings metadata.');
  }

  const tiers = Object.fromEntries(
    Object.entries(parsed.data.overrides.tiers ?? {}).map(([name, preset]) => [
      name,
      normalizePersistedOverridePreset(name, preset),
    ])
  );
  const aliases = Object.fromEntries(
    Object.entries(parsed.data.overrides.aliases ?? {}).map(([name, preset]) => [

View on GitHub (pinned to 0773b97458)

Solutions

  1. Correct the binding's effort value in the run's model_bindings metadata to a schema-valid effort (e.g. minimal|low|medium|high per the schema)
  2. Delete and re-launch the run with valid model_bindings
  3. Check which writer produced the metadata and align it with runModelBindingsMetadataSchema

Example fix

// before
"bindings": { "node1": { "effort": "maximum" } }
// after
"bindings": { "node1": { "effort": "high" } }
Defensive patterns

Strategy: validation

Validate before calling

const parsed = runModelBindingsMetadataSchema.safeParse(metadata);
if (!parsed.success) {
  const bad = parsed.error.issues.find(i => i.path.includes('effort'));
  if (bad) throw new Error(`Binding '${String(bad.path[2])}' has invalid effort: ${bad.message}`);
}

Type guard

function hasValidEffort(b: { effort?: unknown }): boolean {
  return runModelBindingsMetadataSchema.shape.bindings
    .element.pick({ effort: true }).safeParse(b).success;
}

Try / catch

try {
  await executeWorkflow(runId);
} catch (err) {
  if (err instanceof Error && /has an invalid effort/.test(err.message)) {
    console.error(`${err.message} — fix the effort value in model_bindings metadata.`);
  } else throw err;
}

Prevention

When it happens

Trigger: executeWorkflow reads a run whose stored binding entry has an effort value outside the schema's enum (e.g. 'maximum' or a misspelled 'hight'); metadata written by a different/older schema version; hand-edited database rows.

Common situations: Typo in an effort value when editing run metadata; writer/reader schema drift after an upgrade; test fixtures with made-up effort strings.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


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