{"record":{"id":"46da9c99b9378194","repo":"bytedance/deer-flow","slug":"journal-journal-path-contains-facts-without-agen","errorCode":null,"errorMessage":"Journal {journal_path} contains facts without agentName","messagePattern":"Journal (.+?) contains facts without agentName","errorType":"exception","errorClass":"MemoryStorageCorruption","httpStatus":null,"severity":"error","filePath":"backend/packages/harness/deerflow/agents/memory/backends/deermem/deermem/core/storage.py","lineNumber":690,"sourceCode":"            old_entries = journal.get(\"oldEntries\", {})\n            agent_name = journal.get(\"agentName\")\n            if agent_name is not None and not isinstance(agent_name, str):\n                raise TypeError(\"agentName must be a string or null\")\n        except (OSError, json.JSONDecodeError, KeyError, TypeError) as exc:\n            raise MemoryStorageCorruption(f\"Invalid memory operation journal {journal_path}: {exc}\") from exc\n        recovery_dir = path.parent / \".recovery\" / operation_id\n        if state == \"prepared\":\n            backup_manifest = recovery_dir / \"memory.json\"\n            if backup_manifest.exists():\n                _atomic_write(path, backup_manifest.read_bytes())\n            elif int(journal.get(\"expectedRevision\") or 0) == 0:\n                path.unlink(missing_ok=True)\n            if isinstance(old_entries, dict):\n                old_ids = set(old_entries)\n                for fact_id in journal.get(\"factIds\", []):\n                    if fact_id not in old_ids:\n                        if agent_name is None:\n                            raise MemoryStorageCorruption(f\"Journal {journal_path} contains facts without agentName\")\n                        fact_file_path(path, str(fact_id), agent_name=agent_name).unlink(missing_ok=True)\n                for fact_id, entry in old_entries.items():\n                    if not isinstance(fact_id, str) or not fact_id or any(character not in \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-\" for character in fact_id):\n                        raise MemoryStorageCorruption(f\"Journal {journal_path} contains an invalid fact id\")\n                    if not isinstance(entry, dict) or not isinstance(entry.get(\"path\"), str):\n                        continue\n                    backup = recovery_dir / f\"{fact_id}.md\"\n                    if backup.exists():\n                        _atomic_write(_safe_relative_path(path.parent, entry[\"path\"], label=\"journal\"), backup.read_bytes())\n        elif state != \"committed\":\n            raise MemoryStorageCorruption(f\"Unknown journal state {state!r} in {journal_path}\")\n        if recovery_dir.exists():\n            shutil.rmtree(recovery_dir)\n        journal_path.unlink(missing_ok=True)\n\n    def _commit_changes_locked(\n        self,\n        path: Path,","sourceCodeStart":672,"sourceCodeEnd":708,"githubUrl":"https://github.com/bytedance/deer-flow/blob/1dd6ba1acb03700589994b0366c5d1c7d05e2eff/backend/packages/harness/deerflow/agents/memory/backends/deermem/deermem/core/storage.py#L672-L708","documentation":"Error \"Journal {journal_path} contains facts without agentName\" thrown in bytedance/deer-flow.","triggerScenarios":"Thrown at backend/packages/harness/deerflow/agents/memory/backends/deermem/deermem/core/storage.py:690 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the offending journal file; facts without agentName cannot be routed.","Manually add agentName to the journal entries if the data must be preserved, then retry."],"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-15T17:31:12.345Z"}