Skip to content

[Bug]: hindsight-openclaw plugin displays raw memories as visible user messages instead of system context #287

@mikecolligon-max

Description

@mikecolligon-max

Bug Description

Summary

When using the @vectorize-io/hindsight-openclaw plugin (v0.4.7) with OpenClaw (v2026.1.30), retrieved memories are displayed as visible user messages in the chat interface rather than being injected as hidden system context for the LLM.

Expected Behavior

Memories retrieved by the Hindsight plugin should be passed to the LLM as part of the system prompt/context, invisible to the end user in the chat UI.

Actual Behavior

Memories appear as a visible "You" message in the chat containing:

  • The instruction text: "The following are relevant memories from past conversations with this user. Use them to personalize your response but do not display them raw:"
  • Raw JSON-formatted memory data including document_id, chunk_id, score, and content fields
  • The session initialization prompt

This exposes internal system prompts and raw memory data to users, which should remain hidden.

Environment

  • OpenClaw Version: 2026.1.30
  • hindsight-openclaw Version: 0.4.7 (installed via npm)
  • OS: macOS
  • Channel: Direct gateway chat (agent:main:main session)

Steps to Reproduce

  1. Install OpenClaw (v2026.1.30)
  2. Install the hindsight-openclaw plugin via openclaw plugins enable hindsight-openclaw
  3. Configure the plugin in ~/.openclaw/openclaw.json with "plugins": { "entries": { "hindsight-openclaw": { "enabled": true } }, "slots": { "memory": "hindsight-openclaw" } }
  4. Start the OpenClaw gateway with openclaw gateway
  5. Open the gateway dashboard at http://localhost:18789/chat
  6. Start a new chat session using /new or click "New session"
  7. Observe that the first "You" message contains raw memory data and system prompts that should be hidden

Additional Context

The issue persists even after starting new sessions. The memories are correctly retrieved but are being injected at the wrong point in the message pipeline, causing them to appear as user-visible content rather than system context.

Disabling the plugin via the Config UI stops the memory injection, but existing sessions retain the corrupted message history.

Expected Behavior

Memories retrieved by the Hindsight plugin should be passed to the LLM as part of the system prompt/context, invisible to the end user in the chat UI. The user should only see their own messages and the assistant's responses, not the internal memory retrieval data.

Actual Behavior

Memories appear as a visible "You" message in the chat containing:

  • The instruction text: "The following are relevant memories from past conversations with this user. Use them to personalize your response but do not display them raw:"
  • Raw JSON-formatted memory data including document_id, chunk_id, score, and content fields
  • The session initialization prompt

This exposes internal system prompts and raw memory data to users, which should remain hidden.

Version

No response

LLM Provider

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions