openclaw - 💡(How to fix) Fix Bug: Control UI image attachments not passed to Agent [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#56776Fetched 2026-04-08 01:47:55
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0

Error Message

When sending image attachments through the OpenClaw Control UI (webchat channel), the images are successfully uploaded and saved to media/inbound/ directory, but the Agent does not receive the image data. The image tool fails with image required error.

Root Cause

Root Cause: In the chat.send RPC handler, the ctx object passed to dispatchInboundMessage does not include MediaPaths and MediaTypes properties.

Fix Action

Fix / Workaround

Root Cause: In the chat.send RPC handler, the ctx object passed to dispatchInboundMessage does not include MediaPaths and MediaTypes properties.

Workaround: Save the image locally and tell the Agent the file path.

RAW_BUFFERClick to expand / collapse

When sending image attachments through the OpenClaw Control UI (webchat channel), the images are successfully uploaded and saved to media/inbound/ directory, but the Agent does not receive the image data. The image tool fails with image required error.

Environment:

  • OpenClaw version: v2026.3.28
  • OS: Windows 10/11
  • Channel: webchat (Control UI)

Root Cause: In the chat.send RPC handler, the ctx object passed to dispatchInboundMessage does not include MediaPaths and MediaTypes properties.

Fix: Add MediaPaths and MediaTypes to the ctx object after images are persisted.

Workaround: Save the image locally and tell the Agent the file path.


Thanks for the great project!

extent analysis

Fix Plan

To resolve the issue, we need to modify the chat.send RPC handler to include MediaPaths and MediaTypes in the ctx object.

Code Changes

Here are the steps to update the code:

  • Locate the chat.send RPC handler function.
  • After the image is persisted, add the following lines to include MediaPaths and MediaTypes in the ctx object:
ctx.MediaPaths = [image_path]  # assuming image_path is the path where the image is saved
ctx.MediaTypes = ['image/jpeg']  # assuming the image type is JPEG
  • Update the dispatchInboundMessage function call to pass the updated ctx object.

Example code snippet:

def chat_send_rpc_handler(ctx, message):
    # ... (image upload and persistence code)
    image_path = 'media/inbound/image.jpg'
    ctx.MediaPaths = [image_path]
    ctx.MediaTypes = ['image/jpeg']
    dispatchInboundMessage(ctx, message)

Verification

To verify the fix, send an image attachment through the OpenClaw Control UI and check if the Agent receives the image data correctly.

Extra Tips

Make sure to handle cases where multiple images are uploaded and update the MediaPaths and MediaTypes lists accordingly. Additionally, consider adding error handling for cases where image persistence fails.

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