openclaw - 💡(How to fix) Fix [Bug]: Control UI leaks internal OpenClaw runtime context into visible chat messages [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#70289Fetched 2026-04-23 07:26:39
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Author
Participants
Timeline (top)
labeled ×1

I’m seeing internal runtime/subagent handoff content rendered directly in the Control UI chat stream instead of being hidden/sanitized. This exposed internal context blocks that looked like normal conversation messages.

Root Cause

Confusing UX because internal messages can look like user-authored messages Internal orchestration details are exposed in the visible chat transcript Makes it harder to distinguish real conversation from runtime plumbing

RAW_BUFFERClick to expand / collapse

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

I’m seeing internal runtime/subagent handoff content rendered directly in the Control UI chat stream instead of being hidden/sanitized. This exposed internal context blocks that looked like normal conversation messages.

Steps to reproduce

l was just asking openclaw to preform some tasks via the web gui. The issue happens periodically and seems to be independent of the type of task.

Expected behavior

Here is what openclaw observer:

Messages containing markers like:
    <<<BEGIN_OPENCLAW_INTERNAL_CONTEXT>>>
    OpenClaw runtime context (internal):
    [Internal task completion event]
    <<<BEGIN_UNTRUSTED_CHILD_RESULT>>>
These appeared in the normal chat transcript, and in at least one case looked like they were authored by the user even though they were clearly system/internal handoff content.
I also saw related internal/tool output leak via visible system lines after exec failures.

Expected behavior

Internal runtime context for subagent completions and similar orchestration events should not be shown raw in the Control UI chat stream.
Those internal blocks should be sanitized/stripped and only the rewritten assistant-facing result should be displayed.

Why I think this is a bug The installed OpenClaw codebase appears to already know these are internal-only markers and contains stripping/sanitization logic for them. For example, in my local install I found references like:

docs/tools/subagents.md says the completion handoff is runtime-generated internal context and should be rewritten into normal assistant voice rather than forwarded raw.
dist/sanitize-user-facing-text-*.js
    contains INTERNAL_RUNTIME_CONTEXT_BEGIN = "<<<BEGIN_OPENCLAW_INTERNAL_CONTEXT>>>"
    contains logic for stripping internal runtime context
dist/task-status-*.js
    contains stripInlineLeakedInternalContext(...)
    explicitly checks for:
        <<<END_OPENCLAW_INTERNAL_CONTEXT>>>
        OpenClaw runtime context (internal):
        [Internal task completion event]
dist/internal-events-*.js
    contains the marker [Internal task completion event]

So this looks like a pipeline/rendering bug where internal completion events are reaching the visible Control UI transcript before, or instead of, going through the intended sanitization/user-facing rewrite path.

Environment

OpenClaw Control UI / webchat
Windows host
observed on 2026-04-22
reproduced while working with subagent completion events and also during exec/system-result surfacing

Impact

Confusing UX because internal messages can look like user-authored messages
Internal orchestration details are exposed in the visible chat transcript
Makes it harder to distinguish real conversation from runtime plumbing

Likely area to inspect

Control UI/webchat message rendering path for internal/system/subagent completion events
any code path that bypasses sanitizeUserFacingText(...) or equivalent stripping before transcript display
subagent completion announce/handoff rendering, especially when timeout/failure paths occur

If helpful, I can provide

exact raw leaked message examples
the local file references where the internal markers and sanitization logic were found

Actual behavior

I’m seeing internal runtime/subagent handoff content rendered directly in the Control UI chat stream instead of being hidden/sanitized. This exposed internal context blocks that looked like normal conversation messages.

OpenClaw version

v2026.4.20

Operating system

windows 11

Install method

No response

Model

gpt 5.4

Provider / routing chain

openclaw - gpt5.4 OAuth

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

TL;DR

The most likely fix involves ensuring that all internal runtime context is properly sanitized before being rendered in the Control UI chat stream, potentially by verifying that the sanitizeUserFacingText function is being called correctly for all subagent completion events.

Guidance

  • Review the Control UI/webchat message rendering path to ensure that internal/system/subagent completion events are being properly sanitized before display.
  • Verify that the sanitizeUserFacingText function is being called for all subagent completion events, and that it is correctly stripping internal runtime context markers such as <<<BEGIN_OPENCLAW_INTERNAL_CONTEXT>>> and <<<END_OPENCLAW_INTERNAL_CONTEXT>>>.
  • Inspect the subagent completion announce/handoff rendering code, especially in timeout/failure paths, to ensure that internal orchestration details are not being exposed in the visible chat transcript.
  • Consider providing exact raw leaked message examples to help identify the specific issue and improve the sanitization logic.

Example

No specific code example can be provided without more information, but the sanitizeUserFacingText function should be reviewed to ensure it is correctly implemented and called for all relevant events.

Notes

The issue may be related to a pipeline/rendering bug where internal completion events are reaching the visible Control UI transcript before being sanitized. The provided information suggests that the OpenClaw codebase already contains logic for stripping internal runtime context, but it may not be being applied correctly in all cases.

Recommendation

Apply a workaround to ensure that all internal runtime context is properly sanitized before being rendered in the Control UI chat stream, such as by adding additional logging or debugging statements to identify where the sanitization is failing. This will help to improve the user experience and prevent internal orchestration details from being exposed.

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

Here is what openclaw observer:

Messages containing markers like:
    <<<BEGIN_OPENCLAW_INTERNAL_CONTEXT>>>
    OpenClaw runtime context (internal):
    [Internal task completion event]
    <<<BEGIN_UNTRUSTED_CHILD_RESULT>>>
These appeared in the normal chat transcript, and in at least one case looked like they were authored by the user even though they were clearly system/internal handoff content.
I also saw related internal/tool output leak via visible system lines after exec failures.

Expected behavior

Internal runtime context for subagent completions and similar orchestration events should not be shown raw in the Control UI chat stream.
Those internal blocks should be sanitized/stripped and only the rewritten assistant-facing result should be displayed.

Why I think this is a bug The installed OpenClaw codebase appears to already know these are internal-only markers and contains stripping/sanitization logic for them. For example, in my local install I found references like:

docs/tools/subagents.md says the completion handoff is runtime-generated internal context and should be rewritten into normal assistant voice rather than forwarded raw.
dist/sanitize-user-facing-text-*.js
    contains INTERNAL_RUNTIME_CONTEXT_BEGIN = "<<<BEGIN_OPENCLAW_INTERNAL_CONTEXT>>>"
    contains logic for stripping internal runtime context
dist/task-status-*.js
    contains stripInlineLeakedInternalContext(...)
    explicitly checks for:
        <<<END_OPENCLAW_INTERNAL_CONTEXT>>>
        OpenClaw runtime context (internal):
        [Internal task completion event]
dist/internal-events-*.js
    contains the marker [Internal task completion event]

So this looks like a pipeline/rendering bug where internal completion events are reaching the visible Control UI transcript before, or instead of, going through the intended sanitization/user-facing rewrite path.

Environment

OpenClaw Control UI / webchat
Windows host
observed on 2026-04-22
reproduced while working with subagent completion events and also during exec/system-result surfacing

Impact

Confusing UX because internal messages can look like user-authored messages
Internal orchestration details are exposed in the visible chat transcript
Makes it harder to distinguish real conversation from runtime plumbing

Likely area to inspect

Control UI/webchat message rendering path for internal/system/subagent completion events
any code path that bypasses sanitizeUserFacingText(...) or equivalent stripping before transcript display
subagent completion announce/handoff rendering, especially when timeout/failure paths occur

If helpful, I can provide

exact raw leaked message examples
the local file references where the internal markers and sanitization logic were found

Still need to ship something?

×6

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

Back to top recommendations

TRENDING