openclaw - 💡(How to fix) Fix Control UI/webchat leaks runtime startup context into visible chat history after /new or /reset [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#69671Fetched 2026-04-22 07:49:31
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Author
Participants

The Control UI/webchat chat history renders runtime-owned startup context as visible user-message content after bare /new or /reset.

This leaks internal prompt scaffolding such as:

  • [Startup context loaded by runtime]
  • [Untrusted daily memory: ...]
  • BEGIN_QUOTED_NOTES / END_QUOTED_NOTES
  • [Bootstrap truncation warning]

Root Cause

stripInboundMetadata() recognizes and strips inbound metadata sentinels such as:

  • Conversation info (untrusted metadata):
  • Sender (untrusted metadata):
  • Thread starter (untrusted, for context):
  • trailing Untrusted context (...)
  • active-memory prefix blocks

But it does not recognize the startup-context markers introduced by the runtime prelude, so the raw startup context survives sanitization and reaches the dashboard unchanged.

RAW_BUFFERClick to expand / collapse

Summary

The Control UI/webchat chat history renders runtime-owned startup context as visible user-message content after bare /new or /reset.

This leaks internal prompt scaffolding such as:

  • [Startup context loaded by runtime]
  • [Untrusted daily memory: ...]
  • BEGIN_QUOTED_NOTES / END_QUOTED_NOTES
  • [Bootstrap truncation warning]

Environment

  • OpenClaw 2026.4.15
  • Reproduced in Control UI / webchat
  • Also checked 2026.4.19-beta.2 tarball, and could not find a fix in the stripping path there either

Repro

  1. Open Control UI / webchat
  2. Send bare /new (or /reset)
  3. Observe the first visible chat message in the dashboard

Actual behavior

The dashboard shows the raw runtime startup prelude and injected daily-memory blocks in the conversation, as if they were user-visible message text.

Expected behavior

Startup context should still be included for the model, but it should be stripped from the user-visible chat history in Control UI/webchat.

Investigation notes

The issue appears to be in the display sanitization path, not in user config or workspace files.

Relevant flow

  • buildSessionStartupContextPrelude() in startup-context-*.js generates the runtime prelude starting with [Startup context loaded by runtime]
  • In get-reply-*.js, that prelude is prepended to baseBodyForPrompt for bare /new / /reset
  • The combined message is stored in the session transcript as a role: "user" message
  • Control UI history uses the transcript sanitization/display path:
    • stripEnvelopeFromMessage()
    • stripInboundMetadata()

Root cause

stripInboundMetadata() recognizes and strips inbound metadata sentinels such as:

  • Conversation info (untrusted metadata):
  • Sender (untrusted metadata):
  • Thread starter (untrusted, for context):
  • trailing Untrusted context (...)
  • active-memory prefix blocks

But it does not recognize the startup-context markers introduced by the runtime prelude, so the raw startup context survives sanitization and reaches the dashboard unchanged.

Evidence

On an affected transcript, the first stored user message contains the full startup prelude as content, including daily memory excerpts and truncation warnings.

This reproduces across sessions after the startup-context feature became active, and is not caused by deleting/recreating workspace files like BOOTSTRAP.md or HEARTBEAT.md.

Suggested fix

Add startup-context markers to the display/history stripping path, likely alongside stripInboundMetadata() / stripEnvelopeFromMessage(), so these blocks are hidden in user-visible chat history while still being preserved for runtime/model use.

At minimum, strip blocks beginning with:

  • [Startup context loaded by runtime]
  • [Untrusted daily memory:
  • [Bootstrap truncation warning]

and their associated quoted-note sections.

extent analysis

TL;DR

Update the stripInboundMetadata() function to recognize and strip startup-context markers, such as [Startup context loaded by runtime] and [Untrusted daily memory:, to prevent them from being displayed in the user-visible chat history.

Guidance

  • Review the stripInboundMetadata() function in the display sanitization path to ensure it correctly identifies and removes startup-context markers.
  • Add the necessary logic to strip blocks starting with [Startup context loaded by runtime], [Untrusted daily memory:, and [Bootstrap truncation warning], as well as their associated quoted-note sections.
  • Verify that the updated function correctly removes these markers from the user-visible chat history while preserving them for runtime/model use.
  • Test the changes with different scenarios, including bare /new and /reset commands, to ensure the fix works as expected.

Example

function stripInboundMetadata(message) {
  // Existing logic to strip inbound metadata sentinels
  // ...

  // New logic to strip startup-context markers
  message = message.replace(/\[Startup context loaded by runtime\].*?\[End of startup context\]/gs, '');
  message = message.replace(/\[Untrusted daily memory:.*?\]/gs, '');
  message = message.replace(/\[Bootstrap truncation warning\].*?\]/gs, '');
  message = message.replace(/BEGIN_QUOTED_NOTES.*?END_QUOTED_NOTES/gs, '');

  return message;
}

Notes

The suggested fix assumes that the stripInboundMetadata() function is the correct place to add the new logic. However, further investigation may be needed to ensure that this is the case and that the changes do not introduce any unintended side effects.

Recommendation

Apply the workaround by updating the stripInboundMetadata() function to recognize and strip startup-context markers, as this is the most direct and effective way to address the issue.

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

Startup context should still be included for the model, but it should be stripped from the user-visible chat history in Control UI/webchat.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix Control UI/webchat leaks runtime startup context into visible chat history after /new or /reset [1 participants]