hermes - 💡(How to fix) Fix OpenViking plugin: on_memory_write mirroring silently fails — 3 bugs [2 pull requests]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

except Exception as e: logger.debug("OpenViking memory mirror failed: %s", e)

Root Cause

There are also 3 stale openviking-server processes running (PIDs 30508, 401, 302) on this machine. This might contribute to resource is busy errors, but the root cause is the mirror code defects above.

Fix Action

Fixed

Code Example

if not self._client or action != "add" or not content:
    return

---

client.post("/api/v1/content/write", {
    "uri": uri,
    "content": content,
    "mode": "create",
})

---

except Exception as e:
    logger.debug("OpenViking memory mirror failed: %s", e)
RAW_BUFFERClick to expand / collapse

Bug Description

The OpenViking memory plugin (plugins/memory/openviking/__init__.py) has an on_memory_write hook that is supposed to mirror built-in memory() writes to the Viking knowledge base. In practice, the mirroring has never worked over 2-3 weeks of daily use. After investigating the source, three concrete bugs explain why.

Environment

  • Hermes Agent v0.14.0 (2026.5.16), up to date
  • OpenViking server running at localhost:1933, healthy
  • memory.provider: openviking in config.yaml, hermes memory status shows "available ✓"
  • WSL2 Ubuntu

Three bugs found in source

Bug 1: Only mirrors action="add" — replace/remove silently skipped

Line 642:

if not self._client or action != "add" or not content:
    return

The built-in memory() tool supports three actions: add, replace, remove. But on_memory_write only processes add. Every replace and remove call is dropped without any indication.

In practice, most long-lived memory entries are created once with add and then updated with replace multiple times. Those updates never reach Viking.

Bug 2: mode="create" causes collisions on re-add

Line 657:

client.post("/api/v1/content/write", {
    "uri": uri,
    "content": content,
    "mode": "create",
})

The URI is built with uuid.uuid4().hex[:12] — unique per call. But when the same memory entry is re-added (e.g. after a remove+add cycle, or when the built-in store is rebuilt), OpenViking rejects duplicate URIs with INVALID_ARGUMENT: resource is busy and cannot be written now. There is no mode="upsert" or mode="update" fallback.

Bug 3: All failures logged at logger.debug() — invisible in production

Line 660:

except Exception as e:
    logger.debug("OpenViking memory mirror failed: %s", e)

The mirror runs in a daemon thread and catches all exceptions at DEBUG level. With default log settings (INFO+), these failures produce zero visible output. Searching errors.log and agent.log for WARNING/ERROR yields nothing — even though the mirror has been silently failing for weeks.

After days of use, the Viking user/default/memories/ directory had only 2 entries (vs 30+ in built-in memory), confirming the mirror path never successfully completed.

Expected Behavior

on_memory_write should:

  1. Handle all three actions: add, replace, remove
  2. Use upsert semantics instead of create-only
  3. Log failures at WARNING level so users can detect issues

Additional finding

There are also 3 stale openviking-server processes running (PIDs 30508, 401, 302) on this machine. This might contribute to resource is busy errors, but the root cause is the mirror code defects above.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix OpenViking plugin: on_memory_write mirroring silently fails — 3 bugs [2 pull requests]