mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-31 19:16:29 +00:00
memories/MEMORY.md is the "§"-delimited store written by MemoryStore, not a markdown document. parse_existing_memory_entries() fell back to extract_markdown_entries() -- the *source* parser for CLAUDE.md / AGENTS.md -- whenever the destination held no delimiter, which is exactly the case for a single-entry store or one that was hand-edited or shell-appended. That extractor skips fenced code blocks, skips table rows, splits a block into one entry per bullet and reflows paragraphs. The shredded result was then written straight back over the user's store and reported as "Imported", with no backup to recover from. Parse the destination the way MemoryStore._parse_entries does: split on ENTRY_DELIMITER only, so a store with no delimiter is one intact entry. extract_markdown_entries() is unchanged and still used on the sources, where it is correct. Also restore the safety net the port dropped. The openclaw migration script this module was ported from calls maybe_backup(destination) before rewriting a memory store; the port did not. Snapshot the store to <name>.bak.<unix_ts> (same naming as MemoryStore._backup_drifted_file), refuse to rewrite when the snapshot fails, and write via temp file + atomic rename so an interrupted import cannot leave a truncated store and a symlinked MEMORY.md stays a symlink. The identical fallback lives in openclaw_to_hermes.py, where it is reached from migrate_memory() (memories/MEMORY.md and memories/USER.md) and migrate_daily_memory(); fixed there too. |
||
|---|---|---|
| .. | ||
| autonomous-ai-agents | ||
| blockchain | ||
| communication | ||
| creative | ||
| data-science | ||
| devops | ||
| dogfood | ||
| email/agentmail | ||
| finance | ||
| gaming | ||
| health | ||
| mcp | ||
| migration | ||
| mlops | ||
| payments | ||
| productivity | ||
| research | ||
| security | ||
| software-development | ||
| web-development | ||
| yuanbao | ||
| DESCRIPTION.md | ||