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
- 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
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
- 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
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
- Invalid run config at 'document': expected an object
- Unknown run config key '${key}'.
- Run config cannot set both 'assistant' and 'defaultAssistant
- Invalid run config at 'docs': expected an object
- Unknown run config key 'docs.${unknownDocsKey}'.
AI-assisted analysis of coleam00/Archon@0773b97458 (2026-09-01).
Data as JSON: /api/errors/9be5725d628b932f.
Report an issue: GitHub.