openclaw - 💡(How to fix) Fix [Bug]: Internal media helper text leaks into visible chat/history around media handling/compaction [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#70182Fetched 2026-04-23 07:28:08
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Author
Participants

Internal OpenClaw media/prompt helper text is leaking into visible conversation content.

Instead of only seeing the user message / attachment / transcript, the chat can show internal lines like:

[media attached: C:\...\file.ogg (audio/ogg; codecs=opus)]
To send an image back, prefer the message tool (media/path/filePath). If you must inline, use MEDIA:https://example.com/image.jpg ...

In the observed case, this also appeared to survive into the post-COMPACTION view/history, which makes it look like prompt-prelude/media-context text is escaping into user-visible conversation state rather than staying internal.

Error Message

User reported this on Windows while using OpenClaw and shared a screenshot showing:

Root Cause

Internal OpenClaw media/prompt helper text is leaking into visible conversation content.

Instead of only seeing the user message / attachment / transcript, the chat can show internal lines like:

[media attached: C:\...\file.ogg (audio/ogg; codecs=opus)]
To send an image back, prefer the message tool (media/path/filePath). If you must inline, use MEDIA:https://example.com/image.jpg ...

In the observed case, this also appeared to survive into the post-COMPACTION view/history, which makes it look like prompt-prelude/media-context text is escaping into user-visible conversation state rather than staying internal.

Code Example

[media attached: C:\...\file.ogg (audio/ogg; codecs=opus)]
To send an image back, prefer the message tool (media/path/filePath). If you must inline, use MEDIA:https://example.com/image.jpg ...
RAW_BUFFERClick to expand / collapse

Summary

Internal OpenClaw media/prompt helper text is leaking into visible conversation content.

Instead of only seeing the user message / attachment / transcript, the chat can show internal lines like:

[media attached: C:\...\file.ogg (audio/ogg; codecs=opus)]
To send an image back, prefer the message tool (media/path/filePath). If you must inline, use MEDIA:https://example.com/image.jpg ...

In the observed case, this also appeared to survive into the post-COMPACTION view/history, which makes it look like prompt-prelude/media-context text is escaping into user-visible conversation state rather than staying internal.

Why this looks like a real bug

The leaked helper string is not user content. It is the internal REPLY_MEDIA_HINT constant in the current installed OpenClaw build:

  • dist/get-reply-XW5nFnK2.js
  • const REPLY_MEDIA_HINT = "To send an image back, prefer the message tool ..."

That same file shows the hint being prepended when inbound media is present:

  • buildInboundMediaNote(ctx)
  • mediaReplyHint = mediaNote ? REPLY_MEDIA_HINT : void 0
  • then included in queuedBody / prefixedCommandBody

So the symptom is not just normal <media:audio> placeholder behavior. It looks like internal prompt/media-context text is leaking into rendered conversation/history.

Observed behavior

User reported this on Windows while using OpenClaw and shared a screenshot showing:

  • raw inbound media envelope text
  • internal helper text (To send an image back...)
  • this showing up around a COMPACTION boundary rather than staying invisible/internal

Expected behavior

  • Internal prompt helper text should never appear in user-visible chat/history
  • Media context lines like [media attached: ...] should remain internal unless intentionally surfaced by a specific UI/debug mode
  • Compaction/replay/history should not serialize or render internal prompt-prelude content as conversation text

Actual behavior

  • The internal media hint leaks into visible chat/history
  • The user sees internal attachment/prompt text instead of a clean message/transcript path
  • The effect appears especially confusing around compaction/replay

Notes

I do not yet have a minimal clean upstream repro on latest Windows, only:

  1. a real Windows user report with screenshot,
  2. confirmation that the exact leaked string exists in prompt-prelude code,
  3. prior related evidence of raw <media:audio> / [media attached: ...] leakage in session artifacts on another install.

So this may be one of:

  • prompt-prelude text leaking into visible history,
  • compaction/replay serializing prompt body instead of user message body,
  • media-context/debug text being rendered on a path where it should be stripped.

Related issues

Related, but not exact duplicates:

  • #15840 [Feature]: Option to suppress <media:audio> placeholder text
  • #6869 Audio files (.ogg) incorrectly detected as text/plain, causing garbled output
  • #22554 Telegram voice messages not auto-transcribed despite tools.media.audio.enabled config (Windows)
  • #65978 Audio transcription skipped on direct delivery to idle agent (WhatsApp)

Those all live in the same family of media/placeholder/transcription problems, but this report is specifically about internal prompt helper text leaking into visible conversation state.

Suggested next check

Trace whether queuedBody / prefixedCommandBody (or their compaction/replay equivalents) can be serialized back into session-visible content when inbound media is present.

extent analysis

TL;DR

The internal OpenClaw media/prompt helper text is leaking into visible conversation content, likely due to incorrect handling of queuedBody or prefixedCommandBody when inbound media is present.

Guidance

  • Investigate the buildInboundMediaNote function to ensure it correctly handles internal helper text and does not prepend it to user-visible content.
  • Verify that queuedBody and prefixedCommandBody are properly sanitized before being serialized into session-visible content, especially around compaction/replay boundaries.
  • Check the compaction/replay logic to ensure it only serializes user message body and not internal prompt-prelude content.
  • Review related issues (#15840, #6869, #22554, #65978) to see if they provide any insight into the media/placeholder/transcription problems that may be contributing to this issue.

Example

No code snippet is provided as the issue does not contain enough information to create a specific example.

Notes

The issue may be specific to the Windows environment, and the lack of a minimal clean upstream repro makes it difficult to provide a definitive solution. Further investigation is needed to determine the root cause of the problem.

Recommendation

Apply a workaround to sanitize queuedBody and prefixedCommandBody before serialization, until the root cause of the issue can be determined and a permanent fix can be implemented. This will help prevent internal prompt helper text from leaking into visible conversation content.

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 prompt helper text should never appear in user-visible chat/history
  • Media context lines like [media attached: ...] should remain internal unless intentionally surfaced by a specific UI/debug mode
  • Compaction/replay/history should not serialize or render internal prompt-prelude content as conversation text

Still need to ship something?

×6

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

Back to top recommendations

TRENDING