{"record":{"id":"9be5725d628b932f","repo":"coleam00/Archon","slug":"run-config-key-key-cannot-apply-classifica","errorCode":null,"errorMessage":"Run config key '${key}' cannot apply: ${classification.reason}.","messagePattern":"Run config key '(.+?)' cannot apply: (.+?)\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/core/src/config/run-config.ts","lineNumber":184,"sourceCode":"  };\n}\n\n/** Parse one explicitly selected sparse run config. Unlike shared config loading, this is fail-fast. */\nexport function parseWorkflowRunConfig(\n  value: unknown,\n  source: WorkflowRunConfigSource\n): WorkflowRunConfigInput {\n  if (!isRecord(value)) {\n    throw new Error(\"Invalid run config at 'document': expected an object\");\n  }\n\n  for (const key of Object.keys(value)) {\n    const classification = keyClassifications[key as ConfigKey] as KeyClassification | undefined;\n    if (!classification) {\n      throw new Error(`Unknown run config key '${key}'.`);\n    }\n    if (classification.kind === 'unavailable') {\n      throw new Error(`Run config key '${key}' cannot apply: ${classification.reason}.`);\n    }\n  }\n\n  if (value.assistant !== undefined && value.defaultAssistant !== undefined) {\n    throw new Error(\n      \"Run config cannot set both 'assistant' and 'defaultAssistant'; use one spelling.\"\n    );\n  }\n\n  const docs = value.docs;\n  if (docs !== undefined) {\n    if (!isRecord(docs)) {\n      throw new Error(\"Invalid run config at 'docs': expected an object\");\n    }\n    const unknownDocsKey = Object.keys(docs).find(key => key !== 'path');\n    if (unknownDocsKey) {\n      throw new Error(`Unknown run config key 'docs.${unknownDocsKey}'.`);\n    }","sourceCodeStart":166,"sourceCodeEnd":202,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/core/src/config/run-config.ts#L166-L202","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Remove the unavailable key from this run config","Apply the setting at the level where it is supported (global config or process startup)","Read classification.reason in the message for why it cannot apply here"],"exampleFix":"// before (workflow run config)\nassistants:\n  pi:\n    maxConcurrent: 2\n// after\nassistants:\n  pi: {}","handlingStrategy":"validation","validationCode":"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}`); }","typeGuard":"function keyIsAvailable(classification) { return classification != null && classification.kind !== 'unavailable'; }","tryCatchPattern":"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; }","preventionTips":["Keep per-workflow run configs minimal; put process/global settings at their owning level","Do not reuse shared/global config files as workflow run configs verbatim","Read the cannot-apply reason in the message; it names the owning level"],"tags":["config","validation","scope"],"backgroundTag":"unsupported-config-key","analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}