{"record":{"id":"be1f5dbb3b7fc550","repo":"OpenBMB/ChatDev","slug":"filememory-requires-at-least-one-file-source-in-co","errorCode":null,"errorMessage":"FileMemory requires at least one file_source in configuration","messagePattern":"FileMemory requires at least one file_source in configuration","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"runtime/node/agent/memory/file_memory.py","lineNumber":40,"sourceCode":"from entity.configs.node.memory import FileMemoryConfig\n\nlogger = logging.getLogger(__name__)\n\n\nclass FileMemory(MemoryBase):\n    \"\"\"\n    File-based memory system that indexes and retrieves content from files/directories.\n    Supports multiple file types, chunking strategies, and incremental updates.\n    \"\"\"\n\n    def __init__(self, store: MemoryStoreConfig):\n        config = store.as_config(FileMemoryConfig)\n        if not config:\n            raise ValueError(\"FileMemory requires a file memory store configuration\")\n        super().__init__(store)\n\n        if not config.file_sources:\n            raise ValueError(\"FileMemory requires at least one file_source in configuration\")\n\n        self.file_config = config\n        self.file_sources: List[FileSourceConfig] = config.file_sources\n        self.index_path = self.file_config.index_path  # Path to store the index\n\n        # Chunking configuration\n        self.chunk_size = 500  # Characters per chunk\n        self.chunk_overlap = 50  # Overlapping characters between chunks\n\n        # File metadata cache {file_path: {hash, chunks_count, ...}}\n        self.file_metadata: Dict[str, Dict[str, Any]] = {}\n\n    def load(self) -> None:\n        \"\"\"\n        Load existing index or build new one from file sources.\n        Validates index integrity and performs incremental updates if needed.\n        \"\"\"\n        if self.index_path and os.path.exists(self.index_path):","sourceCodeStart":22,"sourceCodeEnd":58,"githubUrl":"https://github.com/OpenBMB/ChatDev/blob/4fb2db0ea90375ce1059f44fe03ffbd191a7a169/runtime/node/agent/memory/file_memory.py#L22-L58","documentation":"FileMemory needs at least one configured file_source to index. Even with a valid FileMemoryConfig, an empty file_sources list leaves nothing to ingest and is rejected.","triggerScenarios":"FileMemoryConfig(file_sources=[]) or omitting the file_sources key (defaulting to empty) when constructing FileMemory.","commonSituations":"Dynamically building file_sources from a glob/manifest that matched nothing; forgetting the field in YAML; intending to add sources later but constructing eagerly.","solutions":["Add at least one entry under file_sources in the memory config","If sources come from a glob/scanner, verify it matches files before constructing FileMemory","Delay constructing FileMemory until sources are collected"],"exampleFix":"# before\nFileMemoryConfig(file_sources=[])\n\n# after\nFileMemoryConfig(file_sources=[FileSourceConfig(path='./docs', types=['md'])])","handlingStrategy":"validation","validationCode":"cfg = store.as_config(FileMemoryConfig)\nif cfg is not None and not cfg.file_sources:\n    raise ConfigError('file memory requires at least one file_source')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify glob/manifest yields sources before config","Lint configs for empty file_sources"],"tags":["memory","configuration","empty-list"],"backgroundTag":"missing-config-parameter","analyzedSha":"4fb2db0ea90375ce1059f44fe03ffbd191a7a169","analyzedAt":"2026-08-27T14:35:29.622Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}