{"record":{"id":"a93958e509d766b3","repo":"OpenBMB/ChatDev","slug":"memory-store-payload-missing","errorCode":null,"errorMessage":"memory store payload missing","messagePattern":"memory store payload missing","errorType":"validation","errorClass":"ConfigError","httpStatus":null,"severity":"error","filePath":"entity/configs/node/memory.py","lineNumber":375,"sourceCode":"    @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(\n            name=\"type\",\n            display_name=\"Store Type\",\n            type_hint=\"str\",\n            required=True,\n            description=\"Memory store type\",\n        ),\n        \"config\": ConfigFieldSpec(","sourceCodeStart":357,"sourceCodeEnd":393,"githubUrl":"https://github.com/OpenBMB/ChatDev/blob/4fb2db0ea90375ce1059f44fe03ffbd191a7a169/entity/configs/node/memory.py#L357-L393","documentation":"Raised by MemoryStoreConfig.require_payload when self.config is falsy — i.e. the store object was constructed programmatically without a config payload. from_dict enforces a config block, so hitting this usually means the dataclass was built directly in code.","triggerScenarios":"Constructing a memory store config object via its constructor (or a partial copy) with config=None, then calling require_payload().","commonSituations":"Programmatic construction or mocking of configs in tests; refactors that bypass from_dict; copying a store config and dropping the config attribute.","solutions":["Always build memory store configs through from_dict so the config block is validated and stored","If constructing manually, pass a valid config object (even an empty one) for the store type","Guard calls to require_payload with a check on .config first"],"exampleFix":"# before\ncfg = MemoryStoreConfig(name='s', type='redis', config=None)\npayload = cfg.require_payload()\n# after\ncfg = MemoryStoreConfig.from_dict({'name':'s','type':'redis','config':{}}, path='store')\npayload = cfg.require_payload()","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"def has_store_payload(store) -> bool:\n    return bool(getattr(store, 'config', None))","tryCatchPattern":"try:\n    payload = store.require_payload()\nexcept ConfigError:\n    payload = default_store_payload()","preventionTips":["Always construct via from_dict","Guard require_payload calls with a config check"],"tags":["config","memory-store","api-misuse"],"backgroundTag":"missing-required-config-field","analyzedSha":"4fb2db0ea90375ce1059f44fe03ffbd191a7a169","analyzedAt":"2026-08-27T14:35:29.622Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}