{"record":{"id":"4b74b787e1da588a","repo":"coleam00/Archon","slug":"unable-to-read-run-config-path-error-as-e","errorCode":null,"errorMessage":"Unable to read run config '${path}': ${(error as Error).message}","messagePattern":"Unable to read run config '(.+?)': (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/core/src/config/run-config.ts","lineNumber":226,"sourceCode":"      : {}),\n    ...(value.assistants !== undefined ? { assistants: value.assistants } : {}),\n    ...(value.aliases !== undefined ? { aliases: value.aliases } : {}),\n    ...(value.tiers !== undefined ? { tiers: value.tiers } : {}),\n    ...(value.workflows !== undefined ? { workflows: value.workflows } : {}),\n    ...(isRecord(docs) && docs.path !== undefined ? { docsPath: docs.path } : {}),\n    ...(value.env !== undefined ? { envVars: value.env } : {}),\n  };\n  const parsed = workflowRunConfigLayerSchema.safeParse(candidate);\n  if (!parsed.success) throw validationError(parsed.error);\n  return { layer: normalizeRunConfigSemantics(parsed.data), source };\n}\n\nexport async function loadWorkflowRunConfigFile(path: string): Promise<WorkflowRunConfigInput> {\n  let content: string;\n  try {\n    content = await readFile(path, 'utf8');\n  } catch (error) {\n    throw new Error(`Unable to read run config '${path}': ${(error as Error).message}`);\n  }\n  let value: unknown;\n  try {\n    value = Bun.YAML.parse(content);\n  } catch (error) {\n    throw new Error(`Invalid YAML in run config '${path}': ${(error as Error).message}`);\n  }\n  return parseWorkflowRunConfig(value ?? {}, { kind: 'cli', label: basename(path) });\n}\n\nfunction serializeLayer(layer: WorkflowRunConfigLayer): string {\n  return JSON.stringify(workflowRunConfigLayerSchema.parse(layer));\n}\n\nfunction configuredKeyPaths(layer: WorkflowRunConfigLayer): string[] {\n  const paths: string[] = [];\n  if (layer.assistant !== undefined) paths.push('assistant');\n  for (const [provider, defaults] of Object.entries(layer.assistants ?? {})) {","sourceCodeStart":208,"sourceCodeEnd":244,"githubUrl":"https://github.com/coleam00/Archon/blob/0773b9745896ef0612e709c80845a0f7db315b19/packages/core/src/config/run-config.ts#L208-L244","documentation":"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.","triggerScenarios":"Calling loadWorkflowRunConfigFile(path) with a nonexistent path, a directory instead of a file, or a file the process cannot read; called from runConfig().","commonSituations":"Wrong --config path on the CLI; relative path resolved from an unexpected working directory; file deleted or moved; permission denied.","solutions":["Verify the path exists and is a readable file (ls / stat)","Use an absolute path or check the process working directory","Fix file permissions if the error is EACCES"],"exampleFix":"// before\nawait loadWorkflowRunConfigFile('config.yaml');\n// after\nawait loadWorkflowRunConfigFile('/abs/path/to/run-config.yaml');","handlingStrategy":"try-catch","validationCode":"import { access, constants } from 'node:fs/promises'; async function assertReadable(p) { await access(p, constants.R_OK); }","typeGuard":"null","tryCatchPattern":"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; }","preventionTips":["Resolve config paths to absolute paths before loading","Check file existence and readability before invoking the loader","Use path.resolve against a known base directory instead of relying on CWD"],"tags":["filesystem","config","io"],"backgroundTag":"file-not-found","analyzedSha":"0773b9745896ef0612e709c80845a0f7db315b19","analyzedAt":"2026-09-01T02:28:07.064Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T05:18:18.240Z"}