openclaw - ✅(Solved) Fix [Bug] WebUI: internal metadata displayed in user message input area [2 pull requests, 1 participants]

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…
GitHub stats
openclaw/openclaw#59568Fetched 2026-04-08 02:43:08
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
0
Author
Participants
Timeline (top)
cross-referenced ×2labeled ×2referenced ×1

WebUI displays internal metadata blocks (Conversation info, relevant-memories) in the user message input area instead of filtering them

Root Cause

WebUI displays internal metadata blocks (Conversation info, relevant-memories) in the user message input area instead of filtering them

Fix Action

Fixed

PR fix notes

PR #59578: fix(web-ui): hide user memory scaffolding in chat history

Description (problem / solution / changelog)

Summary

  • strip user-facing <relevant-memories> scaffolding after inbound metadata cleanup in gateway chat history sanitization
  • reuse the same cleanup in Web UI message extraction and normalization so history rendering stays consistent client/server
  • add regression coverage for mixed Conversation info + <relevant-memories> user messages

Testing

  • pnpm test -- src/shared/text/assistant-visible-text.test.ts src/gateway/chat-sanitize.test.ts ui/src/ui/chat/message-extract.test.ts ui/src/ui/chat/message-normalizer.test.ts
  • pnpm check

Closes #59568

Changed files

  • src/gateway/chat-sanitize.test.ts (modified, +20/-0)
  • src/gateway/chat-sanitize.ts (modified, +13/-3)
  • src/shared/text/assistant-visible-text.test.ts (modified, +31/-1)
  • src/shared/text/assistant-visible-text.ts (modified, +2/-2)
  • ui/src/ui/chat/message-extract.test.ts (modified, +20/-0)
  • ui/src/ui/chat/message-extract.ts (modified, +2/-1)
  • ui/src/ui/chat/message-normalizer.test.ts (modified, +20/-0)
  • ui/src/ui/chat/message-normalizer.ts (modified, +5/-1)

PR #59697: fix: strip <relevant-memories> injected by memory plugin from user messages in WebUI

Description (problem / solution / changelog)

Summary

  • Memory plugin's before_agent_start hook prepends <relevant-memories>...</relevant-memories> to user prompts before they are stored in session history
  • stripEnvelopeFromMessages() (server) and processMessageText (WebUI) only stripped these tags from assistant messages, never from user messages
  • This caused internal memory context to appear in the user message bubble in WebUI

Root cause

stripRelevantMemoriesTags was only reachable via stripAssistantInternalScaffolding, which is only called for role === "assistant". User messages went through stripInboundMetadata + stripEnvelope, neither of which handles <relevant-memories> XML tags.

Fix

  • Export stripRelevantMemoriesTags from assistant-visible-text.ts
  • chat-sanitize.ts (stripEnvelopeFromMessage): apply stripRelevantMemoriesTags to user-role message content — fixes the chat.history RPC path
  • message-extract.ts (processMessageText): apply stripRelevantMemoriesTags for user-role messages — fixes the WebUI rendering path
  • Add regression tests in chat-sanitize.test.ts and message-extract.test.ts for both string content and array content shapes

Test plan

  • npx vitest run src/gateway/chat-sanitize.test.ts — 11 tests pass
  • npx vitest run ui/src/ui/chat/message-extract.test.ts — 6 tests pass
  • Start OpenClaw with memory-lancedb extension enabled, send a message, verify user bubble shows only the actual message text

Fixes #59568

🤖 Generated with Claude Code

Changed files

  • src/gateway/chat-sanitize.test.ts (modified, +26/-0)
  • src/gateway/chat-sanitize.ts (modified, +4/-3)
  • src/shared/text/assistant-visible-text.ts (modified, +1/-1)
  • ui/src/ui/chat/message-extract.test.ts (modified, +21/-0)
  • ui/src/ui/chat/message-extract.ts (modified, +2/-1)
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

WebUI displays internal metadata blocks (Conversation info, relevant-memories) in the user message input area instead of filtering them

Steps to reproduce

  1. Use OpenClaw WebUI in a browser
  2. Observe the message input area
  3. Internal system metadata blocks (Conversation info, relevant-memories) appear in the user's message input column

Expected behavior

Internal metadata should be filtered out and not displayed in the user's message input area. Only user-authored messages should be visible.

Actual behavior

WebUI displays raw internal metadata blocks including 'Conversation info (untrusted metadata)' and '<relevant-memories>' content directly in the user message input area. This makes the UI confusing and pollutes the conversation history.

OpenClaw version

2026.3.28

Operating system

macOS 25.4.0

Install method

npm global

Model

minimax/MiniMax-M2.7-highspeed

Provider / routing chain

openclaw -> minimax

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

Impact: All WebUI users are affected. Severity: Annoying/blocks workflow. Frequency: Always. Consequence: The UI becomes confusing and unusable as internal metadata blocks clutter the message input area.

Additional information

Related GitHub Issues: #20221, #23273, #22156, #21109. This is a known bug where stripEnvelopeFromMessages() does not filter these metadata blocks from WebUI display.

extent analysis

TL;DR

The most likely fix involves modifying the stripEnvelopeFromMessages() function to correctly filter out internal metadata blocks from the WebUI display.

Guidance

  • Review the stripEnvelopeFromMessages() function to identify why it's not filtering out 'Conversation info' and '<relevant-memories>' metadata blocks.
  • Verify that the function is being called correctly for all user messages in the WebUI.
  • Check the related GitHub Issues (#20221, #23273, #22156, #21109) for potential solutions or workarounds that may have been proposed or implemented.
  • Consider temporarily modifying the WebUI to hide or remove these metadata blocks as a workaround until a permanent fix is implemented.

Example

No code snippet can be provided without more context about the stripEnvelopeFromMessages() function, but it would likely involve modifying this function to correctly identify and filter out the internal metadata blocks.

Notes

The fix may require updates to the stripEnvelopeFromMessages() function or the WebUI rendering logic, and may involve coordinating with the maintainers of the related GitHub Issues.

Recommendation

Apply a workaround to hide or remove the internal metadata blocks from the WebUI display until a permanent fix can be implemented, as the issue is described as "Annoying/blocks workflow" and affects all WebUI users.

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…

FAQ

Expected behavior

Internal metadata should be filtered out and not displayed in the user's message input area. Only user-authored messages should be visible.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING