Skip to content

[BUG] /memory approve fails with "memory store unavailable" in TUI/dashboard chat #47363

Closed

Description

@fouxdufa

Environment

  • hermes-agent 0.16.0
  • Docker Compose deployment (nousresearch/hermes-agent:latest)
  • Interface: TUI / dashboard chat (slash commands routed through tui_gateway.slash_worker)

Summary

Running /memory approve <id> (or /memory approve all) from the TUI/dashboard chat window always returns memory store unavailable, so pending memory writes can never be approved from that surface. Pending entries pile up in ~/.hermes/pending/memory/ and never reach MEMORY.md / USER.md.

The underlying memory store is healthy — applying the same pending records against a freshly loaded MemoryStore works fine. The bug is purely in how the TUI slash-command handler obtains the store.

Steps to reproduce

  1. Run Hermes with memory.write_approval: true.
  2. In a chat, let the agent stage one or more memory writes (they land in pending/memory/).
  3. In the TUI/dashboard chat, run /memory approve all.
  4. Output: Failed: ... <id>: memory store unavailable for every entry.

Expected

Pending memory writes are applied to MEMORY.md / USER.md, same as the messaging-gateway path.

Actual

Every approval fails with memory store unavailable; nothing is persisted.

Root cause

There are two /memory handlers, and they obtain the MemoryStore differently:

  • Messaging gateway (works) — gateway/slash_commands.py (_handle_memory_command, ~L2192) builds a fresh store before delegating:
    store = MemoryStore()
    store.load_from_disk()
    out = handle_pending_subcommand(wa.MEMORY, args, memory_store=store, ...)
  • CLI / TUI (broken) — hermes_cli/cli_commands_mixin.py (_handle_memory_command, L1409) relies on a live agent's in-memory store:
    store = getattr(self.agent, "_memory_store", None) if getattr(self, "agent", None) else None
    out = handle_pending_subcommand(wa.MEMORY, args, memory_store=store, ...)

In the tui_gateway.slash_worker context the HermesCLI is built for slash-command serving (tui_gateway/slash_worker.py:114), so either no agent is built yet or it is initialized without a memory store — agent._memory_store defaults to None (agent/agent_init.py:1111, only populated at L1125 when memory is enabled and skip_memory is false). With store = None, _apply_one hits the guard and returns the error (hermes_cli/write_approval_commands.py:145-146):

if subsystem == wa.MEMORY:
    if memory_store is None:
        return False, "memory store unavailable"

Suggested fix

Mirror the gateway handler: when self.agent._memory_store is unavailable, construct a fresh on-disk store instead of passing None. e.g. in cli_commands_mixin._handle_memory_command:

store = getattr(self.agent, "_memory_store", None) if getattr(self, "agent", None) else None
if store is None:
    from tools.memory_tool import MemoryStore
    store = MemoryStore()
    store.load_from_disk()

(The store persists to the same MEMORY.md / USER.md, so a fresh instance is safe.)

Workaround

Set memory.write_approval: false so memory writes persist directly and bypass the broken approval surface.

Activity

  1. changed the title [-]/memory approve fails with "memory store unavailable" in TUI/dashboard chat[/-] [+][BUG] /memory approve fails with "memory store unavailable" in TUI/dashboard chat[/+] on Jun 16, 2026
  2. added
    type/bugSomething isn't working
    comp/tuiTerminal UI (ui-tui/ + tui_gateway/)
    comp/cliCLI entry point, hermes_cli/, setup wizard
    tool/memoryMemory tool and memory providers
    P2Medium — degraded but workaround exists
    duplicateThis issue or pull request already exists
    on Jun 16, 2026
  3. alt-glitch commented on Jun 16, 2026

    @alt-glitch

    Duplicate of #46783 — same root cause: the CLI/TUI _handle_memory_command in hermes_cli/cli_commands_mixin.py obtains the store via getattr(self.agent, "_memory_store", None), which is None in the slash-worker/no-live-agent context, tripping the "memory store unavailable" guard. The fix (fall back to a fresh on-disk MemoryStore() like the gateway path) is tracked there (open fix PR #46926).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existscomp/cliCLI entry point, hermes_cli/, setup wizardcomp/tuiTerminal UI (ui-tui/ + tui_gateway/)duplicateThis issue or pull request already existstool/memoryMemory tool and memory providerstype/bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions