coleam00/Archon · error
Invalid YAML in run config '${path}': ${(error as Error).mes
Error message
Invalid YAML in run config '${path}': ${(error as Error).message} What it means
Thrown by loadWorkflowRunConfigFile when a run-config file exists and is readable, but Bun.YAML.parse fails to parse its content as YAML. The library validates the file's syntax before applying schema validation, and reports the parser's own message so the exact YAML defect (bad indentation, tabs, unterminated quotes) is visible. A valid YAML file that fails schema checks produces a different error downstream.
Source
Thrown at packages/core/src/config/run-config.ts:232
...(value.env !== undefined ? { envVars: value.env } : {}),
};
const parsed = workflowRunConfigLayerSchema.safeParse(candidate);
if (!parsed.success) throw validationError(parsed.error);
return { layer: normalizeRunConfigSemantics(parsed.data), source };
}
export async function loadWorkflowRunConfigFile(path: string): Promise<WorkflowRunConfigInput> {
let content: string;
try {
content = await readFile(path, 'utf8');
} catch (error) {
throw new Error(`Unable to read run config '${path}': ${(error as Error).message}`);
}
let value: unknown;
try {
value = Bun.YAML.parse(content);
} catch (error) {
throw new Error(`Invalid YAML in run config '${path}': ${(error as Error).message}`);
}
return parseWorkflowRunConfig(value ?? {}, { kind: 'cli', label: basename(path) });
}
function serializeLayer(layer: WorkflowRunConfigLayer): string {
return JSON.stringify(workflowRunConfigLayerSchema.parse(layer));
}
function configuredKeyPaths(layer: WorkflowRunConfigLayer): string[] {
const paths: string[] = [];
if (layer.assistant !== undefined) paths.push('assistant');
for (const [provider, defaults] of Object.entries(layer.assistants ?? {})) {
const fields = Object.keys(defaults);
if (fields.length === 0) paths.push(`assistants.${provider}`);
else for (const field of fields) paths.push(`assistants.${provider}.${field}`);
}
for (const name of Object.keys(layer.aliases ?? {})) paths.push(`aliases.${name}`);
for (const name of Object.keys(layer.tiers ?? {})) paths.push(`tiers.${name}`);View on GitHub (pinned to 0773b97458)
Solutions
- Open the file at `path` and fix the YAML syntax described by the parser message (tabs, indentation, quotes, stray characters).
- Lint the file with a YAML parser before loading (e.g. `bun -e 'Bun.YAML.parse(require("fs").readFileSync("<path>","utf8"))'`) to see the exact line/column.
- Verify you are loading the intended file — the path in the message may point at a non-YAML artifact.
- If the file was machine-generated, regenerate it instead of hand-patching the broken output.
Example fix
// before (run-config.yaml)
providers:
- name: anthropic
key: sk-...
// after
providers:
- name: anthropic
key: sk-... Defensive patterns
Strategy: validation
Validate before calling
import { readFileSync } from 'node:fs';
function isValidYaml(path: string): boolean {
try { Bun.YAML.parse(readFileSync(path, 'utf8')); return true; }
catch (e) { console.error(`${path}: ${(e as Error).message}`); return false; }
} Try / catch
try {
const cfg = loadWorkflowRunConfigFile(path);
} catch (e) {
if ((e as Error).message.startsWith('Invalid YAML in run config')) {
// surface the file path + parser message to the user, fix the YAML
} else throw e;
} Prevention
- Run a YAML linter/formatter (prettier with yaml parser) on run-config files in CI.
- Never use tabs in YAML; configure editors to expand tabs to spaces.
- Generate config files via a script with yaml.dump instead of hand-editing.
- Add a startup smoke test that parses all bundled run-config files.
When it happens
Trigger: Calling loadWorkflowRunConfigFile(path) — directly or through runConfig — with a file whose contents are not syntactically valid YAML: mixed tabs/spaces, bad indentation, unclosed quotes/brackets, duplicate keys rejected by the parser, or accidentally passing a non-YAML file (JSON with trailing commas, TOML, etc.).
Common situations: Hand-editing a run-config YAML file and breaking indentation; pasting config from docs with smart quotes or tabs; a script writing malformed YAML; pointing the loader at the wrong file (a .toml or .env file); a merge conflict marker left in the file.
Related errors
- Invalid run config at 'document': expected an object
- Invalid run config at 'docs': expected an object
- Failed to load config: ${err.message}
- Failed to parse dry-run stub file '${path}': ${(error as Err
- Alias name '${name}' must start with '@' (e.g. '@${name}').
AI-assisted analysis of coleam00/Archon@0773b97458 (2026-09-01).
Data as JSON: /api/errors/e0755055ebd820d3.
Report an issue: GitHub.