{"record":{"id":"e89eeb3bae4d53da","repo":"OpenBMB/ChatDev","slug":"memories-must-be-a-list","errorCode":null,"errorMessage":"memories must be a list","messagePattern":"memories must be a list","errorType":"validation","errorClass":"ConfigError","httpStatus":null,"severity":"error","filePath":"entity/configs/node/agent.py","lineNumber":384,"sourceCode":"        tooling_cfg: List[ToolingConfig] = []\n        if \"tooling\" in mapping and mapping[\"tooling\"] is not None:\n            raw_tooling = mapping[\"tooling\"]\n            if not isinstance(raw_tooling, list):\n                 raise ConfigError(\"tooling must be a list\", extend_path(path, \"tooling\"))\n            for idx, item in enumerate(raw_tooling):\n                tooling_cfg.append(\n                    ToolingConfig.from_dict(item, path=extend_path(path, f\"tooling[{idx}]\"))\n                )\n\n        thinking_cfg = None\n        if \"thinking\" in mapping and mapping[\"thinking\"] is not None:\n            thinking_cfg = ThinkingConfig.from_dict(mapping[\"thinking\"], path=extend_path(path, \"thinking\"))\n\n        memories_cfg: List[MemoryAttachmentConfig] = []\n        if \"memories\" in mapping and mapping[\"memories\"] is not None:\n            raw_memories = mapping[\"memories\"]\n            if not isinstance(raw_memories, list):\n                raise ConfigError(\"memories must be a list\", extend_path(path, \"memories\"))\n            for idx, item in enumerate(raw_memories):\n                memories_cfg.append(\n                    MemoryAttachmentConfig.from_dict(item, path=extend_path(path, f\"memories[{idx}]\"))\n                )\n\n        retry_cfg = None\n        if \"retry\" in mapping and mapping[\"retry\"] is not None:\n            retry_cfg = AgentRetryConfig.from_dict(mapping[\"retry\"], path=extend_path(path, \"retry\"))\n\n        skills_cfg = None\n        if \"skills\" in mapping and mapping[\"skills\"] is not None:\n            skills_cfg = AgentSkillsConfig.from_dict(mapping[\"skills\"], path=extend_path(path, \"skills\"))\n\n        return cls(\n            provider=provider,\n            base_url=base_url,\n            name=model_name,\n            role=role,","sourceCodeStart":366,"sourceCodeEnd":402,"githubUrl":"https://github.com/OpenBMB/ChatDev/blob/4fb2db0ea90375ce1059f44fe03ffbd191a7a169/entity/configs/node/agent.py#L366-L402","documentation":"The 'memories' key of an agent model config is present and non-null but is not a list. Memories are parsed as a list of MemoryAttachmentConfig entries; any other shape is rejected before item parsing begins.","triggerScenarios":"Passing memories as a single dict (one attachment not wrapped in a list), a string, or other non-list value. Absent/null 'memories' skips validation entirely.","commonSituations":"Same single-object-vs-list mistake as tooling; YAML indentation that makes 'memories' a mapping instead of a sequence.","solutions":["Wrap the attachment in a list: \"memories\": [{...}]","Check YAML list syntax (dash items) under 'memories'","Omit 'memories' or set null if no memory attachments are wanted"],"exampleFix":"// before\n\"memories\": {\"memory_id\": \"m1\"}\n// after\n\"memories\": [{\"memory_id\": \"m1\"}]","handlingStrategy":"validation","validationCode":"memories = cfg.get('model', {}).get('memories')\nif memories is not None and not isinstance(memories, list):\n    cfg['model']['memories'] = [memories]","typeGuard":"def has_list_memories(cfg: dict) -> bool:\n    m = cfg.get('model', {}).get('memories')\n    return m is None or isinstance(m, list)","tryCatchPattern":"try:\n    ModelConfig.from_dict(data, path='agent')\nexcept ConfigError as e:\n    if 'memories' in e.path and isinstance(data['model'].get('memories'), dict):\n        data['model']['memories'] = [data['model']['memories']]\n        ModelConfig.from_dict(data, path='agent')\n    else:\n        raise","preventionTips":["Use dash-item YAML lists under 'memories'","Validate shape with a schema (jsonschema/pydantic) before handing dicts to from_dict","Keep authoring helpers that always emit lists"],"tags":["config","agent","memory","validation","python"],"backgroundTag":"schema-validation-failed","analyzedSha":"4fb2db0ea90375ce1059f44fe03ffbd191a7a169","analyzedAt":"2026-08-27T14:35:29.622Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}