openclaw - 💡(How to fix) Fix [webchat] Hide startup trigger message from chat history [1 comments, 2 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#72369Fetched 2026-04-27 05:30:48
View on GitHub
Comments
1
Participants
2
Timeline
1
Reactions
0
Author
Timeline (top)
commented ×1

When a session resets via `/new` or `/reset` in the Control UI WebChat, the startup trigger message is stored in the session transcript and rendered as a visible user message in the chat thread. It looks like a user sent it, but it is an internal system instruction emitted by `openclaw-control-ui`.

The raw text rendered in chat:

A new session was started via /new or /reset. Execute your Session Startup sequence now - read the required files before responding to the user. [...]

Root Cause

Root cause (traced through source)

RAW_BUFFERClick to expand / collapse

Summary

When a session resets via `/new` or `/reset` in the Control UI WebChat, the startup trigger message is stored in the session transcript and rendered as a visible user message in the chat thread. It looks like a user sent it, but it is an internal system instruction emitted by `openclaw-control-ui`.

The raw text rendered in chat:

A new session was started via /new or /reset. Execute your Session Startup sequence now - read the required files before responding to the user. [...]

Environment

  • OpenClaw version: 2026.4.24 (cbcfdf6)
  • OS: macOS (Darwin 25.4.0)
  • Surface: Control UI WebChat

Root cause (traced through source)

dist/startup-context-T0Kl6rrH.js

  • Line 11: BARE_SESSION_RESET_PROMPT_BASE defines the trigger text
  • Line 41: resolveBareSessionResetPromptState() builds the prompt object
  • Line 63–64: buildBareSessionResetPrompt() returns the final string (with timestamp appended)

dist/get-reply-CSQ5BMwG.js

  • Line 2188: isBareSessionReset flag is set for /new and /reset turns
  • Line 2215: baseBodyFinal is set to bareResetPromptState.prompt — the startup trigger text
  • Line 2241: transcriptBodyBase = baseBodyFinal — startup text becomes the stored transcript body
  • Line 2288: transcriptBody: transcriptBodyBase — stored into session history as a user turn

dist/control-ui/assets/index-ckUmEo1l.js

  • Line 711: Sw() — the webchat message filter. Currently only filters:
    • toolresult messages when showToolCalls is false
    • __openclaw.kind === 'compaction' entries (rendered as dividers instead)
    • No filter path exists for startup messages

Why startupContext.enabled: false does not help

Setting agents.defaults.startupContext.enabled: false only controls whether daily memory files are prepended (shouldApplyStartupContext()startupContextPrelude). The trigger text (baseBodyFinal) is set independently from bareResetPromptState.prompt and is always stored as transcriptBodyBase regardless of that flag.

Suggested fix

  1. Tag bare-reset transcript entries with __openclaw: { kind: 'startup' } (same pattern used for compaction at dist/get-reply-CSQ5BMwG.js:2288)
  2. Filter in Sw() (control-ui/assets/index-ckUmEo1l.js:711): skip or replace startup-kind entries with a lightweight "New session" divider, consistent with how compaction dividers work
  3. Optional config: expose agents.defaults.startupContext.showInWebchat (default false) for operators who want the raw prompt visible

Versions confirmed affected

  • 2026.4.24 (cbcfdf6) ✗

extent analysis

TL;DR

Tagging bare-reset transcript entries and filtering them in the Sw() function can help prevent the startup trigger message from being rendered as a visible user message in the chat thread.

Guidance

  • Tag bare-reset transcript entries with __openclaw: { kind: 'startup' } to differentiate them from regular user messages.
  • Modify the Sw() function in control-ui/assets/index-ckUmEo1l.js to filter or replace startup-kind entries with a "New session" divider.
  • Consider adding an optional config agents.defaults.startupContext.showInWebchat to allow operators to choose whether the raw prompt is visible.

Example

// In dist/get-reply-CSQ5BMwG.js
transcriptBodyBase = {
  ...baseBodyFinal,
  __openclaw: { kind: 'startup' }
};

// In control-ui/assets/index-ckUmEo1l.js
function Sw(message) {
  if (message.__openclaw && message.__openclaw.kind === 'startup') {
    // Replace with a "New session" divider or skip rendering
    return null;
  }
  // ...
}

Notes

The suggested fix assumes that the __openclaw property is not used for other purposes in the transcript entries. Additionally, the implementation of the Sw() function may need to be adjusted based on the specific requirements of the webchat interface.

Recommendation

Apply the workaround by tagging bare-reset transcript entries and filtering them in the Sw() function, as this approach allows for a targeted solution without modifying the underlying logic of the startup context.

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

openclaw - 💡(How to fix) Fix [webchat] Hide startup trigger message from chat history [1 comments, 2 participants]