{"record":{"id":"4f340700fc767b07","repo":"OpenBMB/ChatDev","slug":"yaml-root-must-be-a-mapping-4f3407","errorCode":null,"errorMessage":"YAML root must be a mapping","messagePattern":"YAML root must be a mapping","errorType":"validation","errorClass":"ConfigError","httpStatus":null,"severity":"warning","filePath":"entity/config_loader.py","lineNumber":32,"sourceCode":"    load_dotenv_file()\n    env_lookup = build_env_var_map()\n    prepared = dict(data)\n    resolve_design_placeholders(prepared, env_lookup=env_lookup, path=source or \"root\")\n    return prepared\n\n\ndef load_design_from_mapping(data: Mapping[str, Any], *, source: str | None = None) -> DesignConfig:\n    \"\"\"Parse a raw dictionary into a typed :class:`DesignConfig`.\"\"\"\n    prepared = prepare_design_mapping(data, source=source)\n    return DesignConfig.from_dict(prepared, path=\"root\")\n\n\ndef load_design_from_file(path: Path) -> DesignConfig:\n    \"\"\"Read a YAML file and parse it into a :class:`DesignConfig`.\"\"\"\n    with path.open(\"r\", encoding=\"utf-8\") as handle:\n        data = yaml.load(handle, Loader=yaml.FullLoader)\n    if not isinstance(data, Mapping):\n        raise ConfigError(\"YAML root must be a mapping\", path=str(path))\n    return load_design_from_mapping(data, source=str(path))\n","sourceCodeStart":14,"sourceCodeEnd":34,"githubUrl":"https://github.com/OpenBMB/ChatDev/blob/4fb2db0ea90375ce1059f44fe03ffbd191a7a169/entity/config_loader.py#L14-L34","documentation":"ResourceNotFoundError raised by the workflow-args endpoint when the YAML parses and the top-level graph dict exists but its args list is empty. The endpoint requires at least one declared argument to return.","triggerScenarios":"GET args for a workflow YAML like 'graph:\\n  args: []' or one where the graph key simply omits/empties args, or where graph is not shaped as expected so raw_args ends up empty.","commonSituations":"Workflows written without parameterization; refactors that moved args elsewhere in the schema; copy-pasted templates missing the args block.","solutions":["Add an args list under 'graph:' in the workflow YAML (or remove the args block entirely if graph has no args key, but note empty list errors).","Validate your YAML with the same check the server uses before deploying.","If the workflow is intentionally arg-less, don't call the args endpoint for it."],"exampleFix":"# before\ngraph:\n  args: []\n# after\ngraph:\n  args:\n    - param_name:\n        - type: string\n          required: true","handlingStrategy":"validation","validationCode":"const doc = jsYaml.load(content);\nconst args = doc?.graph?.args;\nif (!Array.isArray(args) || args.length === 0) skipArgsFetch(name);","typeGuard":"function hasWorkflowArgs(doc: any): boolean { return Array.isArray(doc?.graph?.args) && doc.graph.args.length > 0; }","tryCatchPattern":"catch (e) { if (e.status === 404 && /args/.test(e.detail)) renderNoArgsPlaceholder(); }","preventionTips":["Declare args in workflow YAML at authoring time","Don't call the args endpoint for arg-less workflows"],"tags":["workflow","yaml","validation","not-found"],"backgroundTag":"empty-workflow-args","analyzedSha":"4fb2db0ea90375ce1059f44fe03ffbd191a7a169","analyzedAt":"2026-08-27T14:35:29.622Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}