openclaw - ✅(Solved) Fix [Bug]: QQ Bot C2C images downloaded successfully but attachments are missing from inbound message to Agent [1 pull requests, 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#76062Fetched 2026-05-03 04:42:44
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
2
Timeline (top)
commented ×1cross-referenced ×1unsubscribed ×1

When a user sends an image via QQ Bot C2C (private chat), the image file is downloaded to ~/.openclaw/media/qqbot/downloads/ successfully, but the Agent does not receive the attachment metadata in the inbound message. The message arrives as pure text with no attachments field, making the Agent unable to see or process the image.

This causes the Agent to miss images entirely and respond as if the image was never sent.

Root Cause

  • QQ Bot users cannot send images to the Agent
  • Agent cannot analyze, describe, or respond to images
  • This affects ALL image sending via QQ Bot C2C, not just specific file types
  • The Agent appears to hallucinate image content because it has no visual data

Fix Action

Fixed

PR fix notes

PR #76084: fix(qqbot): surface C2C msg element attachments

Description (problem / solution / changelog)

Summary

  • normalize QQ Bot C2C and group media from msg_elements into inbound attachments when top-level attachments are absent
  • preserve quoted msg_elements as quote metadata instead of treating quoted media as current-message attachments
  • add dispatcher regression coverage and changelog for #76062

Fixes #76062

Test plan

  • pnpm test extensions/qqbot/src/engine/gateway/event-dispatcher.test.ts extensions/qqbot/src/engine/gateway/inbound-attachments.test.ts extensions/qqbot/src/engine/gateway/outbound-dispatch.test.ts
  • pnpm test src/auto-reply/reply.media-note.test.ts src/agents/pi-embedded-runner/run/images.test.ts
  • pnpm exec oxfmt --check --threads=1 CHANGELOG.md extensions/qqbot/src/engine/gateway/event-dispatcher.ts extensions/qqbot/src/engine/gateway/event-dispatcher.test.ts
  • pnpm check:changed

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • extensions/qqbot/src/engine/gateway/event-dispatcher.test.ts (added, +88/-0)
  • extensions/qqbot/src/engine/gateway/event-dispatcher.ts (modified, +20/-3)

Code Example

{
  "type": "text",
  "text": "看 刚刚拍的",
  "attachments": [{
    "type": "image",
    "filename": "xxx.jpg",
    "url": "...",
    "localPath": "~/.openclaw/media/qqbot/downloads/xxx.jpg"
  }]
}

---

{
  "type": "text",
  "text": "看 刚刚拍的"
}

---

{
  "role": "user",
  "content": [
    {
      "type": "text",
      "text": "看 刚刚拍的"
    }
  ],
  "timestamp": 1777721745498,
  "__openclaw": { "id": "4b05219c", "seq": 455 }
}
RAW_BUFFERClick to expand / collapse

[Bug]: QQ Bot C2C images downloaded successfully but attachments are missing from inbound message to Agent

Summary

When a user sends an image via QQ Bot C2C (private chat), the image file is downloaded to ~/.openclaw/media/qqbot/downloads/ successfully, but the Agent does not receive the attachment metadata in the inbound message. The message arrives as pure text with no attachments field, making the Agent unable to see or process the image.

This causes the Agent to miss images entirely and respond as if the image was never sent.

Bug type

Behavior bug (incorrect output/state without crash)

Steps to reproduce

  1. Configure QQ Bot channel with C2C (private chat) messaging
  2. Send an image from a QQ user to the bot (private chat, NOT group)
  3. Check the Agent's received message in session transcript

Expected behavior

The Agent should receive a message with attachments array containing the image metadata:

{
  "type": "text",
  "text": "看 刚刚拍的",
  "attachments": [{
    "type": "image",
    "filename": "xxx.jpg",
    "url": "...",
    "localPath": "~/.openclaw/media/qqbot/downloads/xxx.jpg"
  }]
}

Actual behavior

The Agent receives ONLY the text part:

{
  "type": "text",
  "text": "看 刚刚拍的"
}

No attachments field is present. The image file IS downloaded to disk, but the attachment info is lost before reaching the Agent.

Evidence from session transcript

From the actual session transcript (agent:main:qqbot:direct:...), the user message at seq 455 shows:

{
  "role": "user",
  "content": [
    {
      "type": "text",
      "text": "看 刚刚拍的"
    }
  ],
  "timestamp": 1777721745498,
  "__openclaw": { "id": "4b05219c", "seq": 455 }
}

Note the absence of any attachments or image content. The Agent then replied as if the image was a sunset/warm sky, having no actual image data to analyze. Only after the user complained and the Agent manually used the read tool to load the local file did it see the actual image (which turned out to be a double rainbow).

Impact

  • QQ Bot users cannot send images to the Agent
  • Agent cannot analyze, describe, or respond to images
  • This affects ALL image sending via QQ Bot C2C, not just specific file types
  • The Agent appears to hallucinate image content because it has no visual data

Environment

ItemValue
OpenClaw version2026.4.23
QQ Bot plugin version2026.4.20
Operating systemWindows 11 (Build 26200)
ChannelQQ Bot C2C (private chat)
Node versionv24.14.0
Install methodnpm global

Root Cause Analysis (Preliminary)

Based on code inspection of dist/extensions/qqbot/gateway-b6_B-JaX.js:

The gateway code does have attachments handling in the message entry building (lines 27-53, 137, 176, 197). However, the actual inbound event processing for QQ Bot C2C messages appears to not populate the attachments field from the QQ Bot event payload.

The image download works (files appear in ~/.openclaw/media/qqbot/downloads/), but the metadata linking the downloaded file to the inbound message is lost somewhere in the pipeline between:

  1. QQ Bot event received
  2. File downloaded
  3. Message passed to Agent

This may be related to the C2C-specific event handler not extracting the attachment URLs from the QQ Bot message structure.

Related Issues

No existing issues found specifically about QQ Bot C2C image reception. The closest related issues are:

  • #68016 — About sending images (outbound), not receiving
  • #67062 — About media allowlist for outbound media SSRF policy
  • #69546 — About QQ Bot routing bindings (unrelated)

Suggested Fix

  1. Check the C2C message event handler in the QQ Bot adapter to ensure attachment URLs are extracted from the QQ Bot payload
  2. Ensure the downloaded file path is linked to the message entry's attachments array
  3. Verify the message builder includes attachments when constructing the Agent's inbound message

extent analysis

TL;DR

The most likely fix involves modifying the C2C message event handler in the QQ Bot adapter to extract attachment URLs from the QQ Bot payload and link the downloaded file path to the message entry's attachments array.

Guidance

  • Review the dist/extensions/qqbot/gateway-b6_BaX.js file, specifically lines 27-53, 137, 176, and 197, to ensure proper attachments handling in the message entry building process.
  • Verify that the C2C-specific event handler correctly extracts attachment URLs from the QQ Bot message structure and populates the attachments field.
  • Check the message builder to ensure it includes attachments when constructing the Agent's inbound message, allowing the Agent to receive and process image metadata.

Example

No code example is provided due to the complexity of the issue and the need for specific implementation details.

Notes

The suggested fix assumes that the issue lies in the C2C message event handler and the message builder. However, further investigation may be required to confirm the root cause and implement a comprehensive solution.

Recommendation

Apply a workaround by modifying the C2C message event handler to extract attachment URLs and link the downloaded file path to the message entry's attachments array, as this is the most likely cause of the issue and has a clear potential solution.

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

The Agent should receive a message with attachments array containing the image metadata:

{
  "type": "text",
  "text": "看 刚刚拍的",
  "attachments": [{
    "type": "image",
    "filename": "xxx.jpg",
    "url": "...",
    "localPath": "~/.openclaw/media/qqbot/downloads/xxx.jpg"
  }]
}

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 - ✅(Solved) Fix [Bug]: QQ Bot C2C images downloaded successfully but attachments are missing from inbound message to Agent [1 pull requests, 1 comments, 2 participants]