openclaw - 💡(How to fix) Fix MEDIA: directive parsed by core but mediaUrls not passed to plugin

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…

Fix Action

Fix / Workaround

After stripping the MEDIA: line in core/session.go, add mediaUrls to the plugin payload before dispatching.

Code Example

[Core] Media directive detected: /path/to/file.xlsx
[Core] Stripping MEDIA: line from text
[Core] Sending to plugin: { text: "...", mediaUrls: ??? }

---

{
  "text": "...",
  // mediaUrls is missing!
}

---

// After stripping MEDIA: line
payload := map[string]interface{}{
    "text":      strippedText,
    "mediaUrls": mediaUrls, // ← this was missing
}
RAW_BUFFERClick to expand / collapse

Bug Description

When sending a message with MEDIA: <file_path> directive, the OpenClaw core correctly parses and strips the MEDIA: line from the text, but the parsed mediaUrls are NOT passed to the plugin's send interface.

Steps to Reproduce

  1. Send a message through a bot that includes MEDIA: /path/to/file.xlsx
  2. The text in the plugin's payload no longer contains the MEDIA: line (core stripping works ✅)
  3. But the mediaUrls field is missing entirely from the payload the plugin receives

Expected Behavior

When the core parses MEDIA: <file>, it should pass mediaUrls: ["file:///path/to/file"] to the plugin's send interface.

Actual Behavior

Plugin receives payload with only text field. mediaUrls is completely missing — plugin has no way to access the attachment.

Evidence

Core debug log shows:

[Core] Media directive detected: /path/to/file.xlsx
[Core] Stripping MEDIA: line from text
[Core] Sending to plugin: { text: "...", mediaUrls: ??? }

But plugin receives:

{
  "text": "...",
  // mediaUrls is missing!
}

Affected Plugins

All plugins using the standard send(text, mediaUrls) interface.

Suggested Fix

After stripping the MEDIA: line in core/session.go, add mediaUrls to the plugin payload before dispatching.

// After stripping MEDIA: line
payload := map[string]interface{}{
    "text":      strippedText,
    "mediaUrls": mediaUrls, // ← this was missing
}

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 MEDIA: directive parsed by core but mediaUrls not passed to plugin