coleam00/Archon · error

Unable to read run config '${path}': ${(error as Error).mess

Error message

Unable to read run config '${path}': ${(error as Error).message}

What it means

loadWorkflowRunConfigFile() wraps fs read failures with the path and the underlying OS error message, so missing files, permission problems, or wrong paths surface with context instead of a raw ENOENT stack.

Source

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

      : {}),
    ...(value.assistants !== undefined ? { assistants: value.assistants } : {}),
    ...(value.aliases !== undefined ? { aliases: value.aliases } : {}),
    ...(value.tiers !== undefined ? { tiers: value.tiers } : {}),
    ...(value.workflows !== undefined ? { workflows: value.workflows } : {}),
    ...(isRecord(docs) && docs.path !== undefined ? { docsPath: docs.path } : {}),
    ...(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 ?? {})) {

View on GitHub (pinned to 0773b97458)

Solutions

  1. Verify the path exists and is a readable file (ls / stat)
  2. Use an absolute path or check the process working directory
  3. Fix file permissions if the error is EACCES

Example fix

// before
await loadWorkflowRunConfigFile('config.yaml');
// after
await loadWorkflowRunConfigFile('/abs/path/to/run-config.yaml');
Defensive patterns

Strategy: try-catch

Validate before calling

import { access, constants } from 'node:fs/promises'; async function assertReadable(p) { await access(p, constants.R_OK); }

Type guard

null

Try / catch

try { cfg = await loadWorkflowRunConfigFile(p); } catch (e) { if (String(e.message).startsWith('Unable to read run config')) console.error(`Check path/permissions: ${p}`); throw e; }

Prevention

When it happens

Trigger: Calling loadWorkflowRunConfigFile(path) with a nonexistent path, a directory instead of a file, or a file the process cannot read; called from runConfig().

Common situations: Wrong --config path on the CLI; relative path resolved from an unexpected working directory; file deleted or moved; permission denied.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


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