{"record":{"id":"267caf75c966c28c","repo":"OpenBMB/ChatDev","slug":"memory-store-requires-config-block","errorCode":null,"errorMessage":"memory store requires config block","messagePattern":"memory store requires config block","errorType":"validation","errorClass":"ConfigError","httpStatus":null,"severity":"error","filePath":"entity/configs/node/memory.py","lineNumber":368,"sourceCode":"\n@dataclass\nclass MemoryStoreConfig(BaseConfig):\n    name: str\n    type: str\n    config: BaseConfig | None = None\n\n    @classmethod\n    def from_dict(cls, data: Mapping[str, Any], *, path: str) -> \"MemoryStoreConfig\":\n        mapping = require_mapping(data, path)\n        name = require_str(mapping, \"name\", path)\n        store_type = require_str(mapping, \"type\", path)\n        try:\n            schema = get_memory_store_schema(store_type)\n        except SchemaLookupError as exc:\n            raise ConfigError(f\"unsupported memory store type '{store_type}'\", extend_path(path, \"type\")) from exc\n\n        if \"config\" not in mapping or mapping[\"config\"] is None:\n            raise ConfigError(\"memory store requires config block\", extend_path(path, \"config\"))\n\n        config_obj = schema.config_cls.from_dict(mapping[\"config\"], path=extend_path(path, \"config\"))\n        return cls(name=name, type=store_type, config=config_obj, path=path)\n\n    def require_payload(self) -> BaseConfig:\n        if not self.config:\n            raise ConfigError(\"memory store payload missing\", extend_path(self.path, \"config\"))\n        return self.config\n\n    FIELD_SPECS = {\n        \"name\": ConfigFieldSpec(\n            name=\"name\",\n            display_name=\"Store Name\",\n            type_hint=\"str\",\n            required=True,\n            description=\"Unique name of the memory store\",\n        ),\n        \"type\": ConfigFieldSpec(","sourceCodeStart":350,"sourceCodeEnd":386,"githubUrl":"https://github.com/OpenBMB/ChatDev/blob/4fb2db0ea90375ce1059f44fe03ffbd191a7a169/entity/configs/node/memory.py#L350-L386","documentation":"MemoryStoreConfig.from_dict requires every memory store entry to carry a non-null 'config' block, because each store type needs its type-specific payload (connection settings, paths, etc.). If 'config' is absent or explicitly null, this ConfigError is raised with the path pointing at 'config'.","triggerScenarios":"Parsing a memory store mapping that omits the 'config' key or sets it to null, e.g. {'name': 's', 'type': 'redis'} with no nested config object.","commonSituations":"Hand-written YAML where the config block is forgotten or left empty as a placeholder; migrations that strip empty blocks; misunderstanding that some stores need no configuration (they still require an empty mapping at minimum).","solutions":["Add a 'config' mapping under the store entry, e.g. config: {} if the store truly needs no options","Copy a working example config for the store type from the docs/tests and fill in required fields","Validate config files with a schema/tool before passing them to from_dict"],"exampleFix":"# before\nstore:\n  name: my_store\n  type: redis\n# after\nstore:\n  name: my_store\n  type: redis\n  config:\n    url: redis://localhost:6379","handlingStrategy":"validation","validationCode":"if not isinstance(store.get('config'), dict):\n    raise ValueError('memory store config block required')","typeGuard":null,"tryCatchPattern":"try:\n    MemoryStoreConfig.from_dict(data, path='store')\nexcept ConfigError as e:\n    if 'requires config block' in str(e):\n        data['store']['config'] = data['store'].get('config') or {}\n        MemoryStoreConfig.from_dict(data, path='store')","preventionTips":["Default missing config blocks to {} when generating configs","Lint configs for required keys per store type"],"tags":["config","memory-store","missing-field"],"backgroundTag":"missing-required-config-field","analyzedSha":"4fb2db0ea90375ce1059f44fe03ffbd191a7a169","analyzedAt":"2026-08-27T14:35:29.622Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}