{"record":{"id":"dedbcfd2e778a5c6","repo":"bytedance/deer-flow","slug":"memory-data-must-be-an-object","errorCode":null,"errorMessage":"memory_data must be an object","messagePattern":"memory_data must be an object","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"backend/packages/harness/deerflow/agents/memory/backends/deermem/deermem/core/storage.py","lineNumber":1078,"sourceCode":"        agent_name: str | None = None,\n        *,\n        user_id: str | None = None,\n        expected_revision: int | None = None,\n    ) -> bool:\n        \"\"\"Compatibility full replacement, diffed into per-fact operations.\n\n        This API must scan the selected agent to determine which omitted facts\n        are deletions, but the commit writes only new/changed/deleted facts.\n        Repository callers should prefer ``apply_changes`` to avoid even that\n        full comparison scan.\n        \"\"\"\n        path = self._get_memory_file_path(agent_name, user_id=user_id)\n        key = self._cache_key(agent_name, user_id=user_id)\n        lock_path = path.parent / \".memory.lock\"\n        notifications: list[RetrievalNotification] = []\n        try:\n            if not isinstance(memory_data, dict):\n                raise ValueError(\"memory_data must be an object\")\n            if agent_name is not None and \"facts\" not in memory_data:\n                raise ValueError(\"memory_data.facts is required for an agent full save\")\n            facts_raw = memory_data.get(\"facts\", [])\n            if not isinstance(facts_raw, list):\n                raise ValueError(\"memory_data.facts must be a list\")\n            if any(not isinstance(fact, dict) for fact in facts_raw):\n                raise ValueError(\"memory_data.facts must contain only fact objects\")\n            if agent_name is None and facts_raw:\n                raise ValueError(\"agent_name is required to persist facts\")\n            with self._scope_lock(key), _process_file_lock(lock_path, float(getattr(self._config, \"file_lock_timeout_seconds\", 10))):\n                self._recover_if_needed(path)\n                ids = [str(fact.get(\"id\") or \"\") for fact in facts_raw]\n                if len(ids) != len(set(ids)):\n                    raise ValueError(\"Duplicate fact ids are not allowed\")\n                old_ids = set(self._agent_entries(path, agent_name, user_id=user_id)) if agent_name is not None else set()\n                summaries = None\n                if agent_name is None:\n                    summaries = {\"user\": memory_data.get(\"user\", {}), \"history\": memory_data.get(\"history\", {})}","sourceCodeStart":1060,"sourceCodeEnd":1096,"githubUrl":"https://github.com/bytedance/deer-flow/blob/1dd6ba1acb03700589994b0366c5d1c7d05e2eff/backend/packages/harness/deerflow/agents/memory/backends/deermem/deermem/core/storage.py#L1060-L1096","documentation":"Error \"memory_data must be an object\" thrown in bytedance/deer-flow.","triggerScenarios":"Thrown at backend/packages/harness/deerflow/agents/memory/backends/deermem/deermem/core/storage.py:1078 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass memory_data as an object matching the documented schema.","Fix the import payload; it is currently a list or scalar."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1dd6ba1acb03700589994b0366c5d1c7d05e2eff","analyzedAt":"2026-08-14T21:20:34.804Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}