coleam00/Archon · error

Run config cannot set both 'assistant' and 'defaultAssistant

Error message

Run config cannot set both 'assistant' and 'defaultAssistant'; use one spelling.

What it means

'assistant' and 'defaultAssistant' are two spellings of the same setting; setting both is ambiguous, so parseWorkflowRunConfig() rejects the document rather than guessing precedence.

Source

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

  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}'.`);
    }
  }

  const candidate = {
    ...(value.assistant !== undefined || value.defaultAssistant !== undefined
      ? { assistant: value.assistant ?? value.defaultAssistant }

View on GitHub (pinned to 0773b97458)

Solutions

  1. Delete one of the two keys, keeping the value you want
  2. Standardize on one spelling ('assistant') across all configs
  3. Check for duplicated settings when merging config layers

Example fix

// before
assistant: claude
defaultAssistant: codex
// after
assistant: claude
Defensive patterns

Strategy: validation

Validate before calling

function assertSingleAssistantSpelling(doc) { if (doc.assistant !== undefined && doc.defaultAssistant !== undefined) throw new Error("Set only one of 'assistant' or 'defaultAssistant'"); }

Type guard

function hasConflictingAssistantKeys(v) { return typeof v === 'object' && v !== null && v.assistant !== undefined && v.defaultAssistant !== undefined; }

Try / catch

try { cfg = parseWorkflowRunConfig(doc, source); } catch (e) { if (String(e.message).includes("'assistant' and 'defaultAssistant'")) console.error('Keep only one assistant spelling in the config'); throw e; }

Prevention

When it happens

Trigger: Passing a run config document where both value.assistant and value.defaultAssistant are defined.

Common situations: Merging two config files or layers that each use a different spelling; hand-editing a config that already had one spelling and adding the other.

Related errors


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