Fix Hermes memory vault sync - #156
Conversation
Reviewer's GuideThis PR fixes Hermes memsearch integration by routing Hermes through explicit vault/built-in-memory synchronization hooks, suppressing incompatible Claude-style output, avoiding no-op USER.md rewrites, and documenting and testing the resulting three-store flow. Sequence diagram for the Hermes three-store memory flowsequenceDiagram
participant Hermes
participant Vault
participant HermesMemory
participant Memsearch
Hermes->>Vault: sync-vault-to-memory.sh
Vault->>HermesMemory: import new facts
Hermes->>Memsearch: session-end.sh
Memsearch->>Vault: capture finalized session
Hermes->>HermesMemory: sync-memory-to-vault.sh
HermesMemory->>Vault: export durable memory
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've reviewed your changes and they look great!
Sourcery assessment
Needs a human reviewer. The new Hermes hooks write synchronized facts into persistent Hermes memory and the knowledge vault, so an incorrect sync could leave bounded stale or incorrect records after the hooks are reverted. The affected memory can be inspected and repaired or regenerated, but reverting alone would not remove data already written.
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7afec6397f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
| if len(hermesTargets) > 0 { | ||
| cfg.Hooks = append(cfg.Hooks, | ||
| hookConfig{Name: "memory-hermes-vault-to-memory", Enabled: true, Event: "SessionStart", Command: managedMemoryHookCommand(root, home, "sync-vault-to-memory.sh"), Timeout: 30, Agents: hermesTargets}, |
There was a problem hiding this comment.
Create the Hermes memory directory before vault import
When memsearch is enabled for a fresh Hermes installation, or whenever ~/.hermes/memories/ has not been initialized, this newly registered SessionStart hook calls vault_to_memory; if the vault profile contains an importable fact, its Path.write_text to ~/.hermes/memories/USER.md raises FileNotFoundError because neither setup nor the function creates the parent directory. The first-session bridge therefore fails instead of importing the facts; create the directory before writing and cover this fresh-profile failure mode.
AGENTS.md reference: AGENTS.md:L46-L46
Useful? React with 👍 / 👎.
Summary
Verification
go test ./...go vet ./...python3 -m unittest discover -s memory/tests -p 'test_*.py' -vdotagents sync --agents=hermesdotagents status --agents=hermeshermes --accept-hooks hooks test on_session_starthermes --accept-hooks hooks test on_session_finalize