coleam00/Archon · error

Run config key '${key}' cannot apply: ${classification.reaso

Error message

Run config key '${key}' cannot apply: ${classification.reason}.

What it means

A recognized run config key is classified as 'unavailable' for this surface, so parseWorkflowRunConfig() rejects it with the stored reason. The key exists in the schema but cannot take effect in the context where this parse runs.

Source

Thrown at packages/core/src/config/run-config.ts:184

  };
}

/** Parse one explicitly selected sparse run config. Unlike shared config loading, this is fail-fast. */
export function parseWorkflowRunConfig(
  value: unknown,
  source: WorkflowRunConfigSource
): WorkflowRunConfigInput {
  if (!isRecord(value)) {
    throw new Error("Invalid run config at 'document': expected an object");
  }

  for (const key of Object.keys(value)) {
    const classification = keyClassifications[key as ConfigKey] as KeyClassification | undefined;
    if (!classification) {
      throw new Error(`Unknown run config key '${key}'.`);
    }
    if (classification.kind === 'unavailable') {
      throw new Error(`Run config key '${key}' cannot apply: ${classification.reason}.`);
    }
  }

  if (value.assistant !== undefined && value.defaultAssistant !== undefined) {
    throw new Error(
      "Run config cannot set both 'assistant' and 'defaultAssistant'; use one spelling."
    );
  }

  const docs = value.docs;
  if (docs !== undefined) {
    if (!isRecord(docs)) {
      throw new Error("Invalid run config at 'docs': expected an object");
    }
    const unknownDocsKey = Object.keys(docs).find(key => key !== 'path');
    if (unknownDocsKey) {
      throw new Error(`Unknown run config key 'docs.${unknownDocsKey}'.`);
    }

View on GitHub (pinned to 0773b97458)

Solutions

  1. Remove the unavailable key from this run config
  2. Apply the setting at the level where it is supported (global config or process startup)
  3. Read classification.reason in the message for why it cannot apply here

Example fix

// before (workflow run config)
assistants:
  pi:
    maxConcurrent: 2
// after
assistants:
  pi: {}
Defensive patterns

Strategy: validation

Validate before calling

function assertNoUnavailableKeys(doc, classifications) { for (const [k, c] of Object.entries(classifications)) if (doc[k] !== undefined && c?.kind === 'unavailable') throw new Error(`Key '${k}' cannot apply here: ${c.reason}`); }

Type guard

function keyIsAvailable(classification) { return classification != null && classification.kind !== 'unavailable'; }

Try / catch

try { cfg = parseWorkflowRunConfig(doc, source); } catch (e) { if (String(e.message).includes('cannot apply')) console.error('Move this key to the config level where it is supported'); throw e; }

Prevention

When it happens

Trigger: Passing a known-but-unavailable key (per keyClassifications) to parseWorkflowRunConfig(), e.g. a key only valid in shared/global config supplied in a per-workflow run config.

Common situations: Reusing a global/shared run config file as a workflow run config; including process-scoped keys like assistants.pi.env or assistants.pi.maxConcurrent in a per-workflow document.

Related errors


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