Skip to content

fix(config): enable tools.media.image for Discord image processing (#506) - #92

Merged
Piboonsak merged 1 commit into
mainfrom
fix/discord-image-506
May 16, 2026
Merged

Piboonsak merged 1 commit into
mainfrom
fix/discord-image-506

Conversation

@Piboonsak

Copy link
Copy Markdown
Owner

🔗 Linked Issue

Closes Piboonsak/Openclaw#506 (bug: NongKung ไม่เห็นรูปภาพที่แนบใน Discord message)

📝 Summary

Root Cause

Production config (config/openclaw.prod.json5) was missing the tools.media.image section entirely. Without it, OpenClaw defaults to disabled image processing — all Discord image attachments were silently ignored.

Fix

Added tools.media section inside tools block:

media: {
  image: {
    enabled: true,
    maxBytes: 10485760, // 10 MB per image
    timeoutSeconds: 30,
    attachments: {
      mode: "all",
      maxAttachments: 5,
    },
  },
},

KI Gate

  • No KI match → proposing new fix
  • KI-073 risk checked: tools.media is a new top-level field under tools (not under agents.defaults). The deploy workflow's selective merge step syncs tools.exec.* but may not sync tools.media.*. This needs to be verified in the deploy workflow after merge.

🏷️ Change Type

  • 🐛 Bug Fix → Procedure B (docs/cicd/03-pre-fix-protocol.md → 04 → 05 → 06)

📋 CI/CD Compliance

⚠️ Risk Assessment

  • Risk: LOW — adding new config section, not modifying existing
  • Deploy path: Hotfix deploy via deploy-hotfix-openclaw-github-private-secrets.yml (no build needed)
  • Rollback: Remove media section, trigger hotfix redeploy

📖 CI/CD Master Index: docs/cicd/README.md
⚠️ Note: After merge, verify tools.media is included in deploy workflow sync whitelist (KI-073)

Copilot AI review requested due to automatic review settings May 16, 2026 07:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the production OpenClaw configuration to add image/media processing settings under the top-level tools block, intended to make Discord image attachments visible to the agent.

Changes:

  • Adds tools.media.image.enabled.
  • Sets image size, timeout, and multi-attachment policy for production config.
Comments suppressed due to low confidence (2)

config/openclaw.prod.json5:439

  • This 10 MB limit will not apply for the current production primary model when it supports native vision: runCapability skips image understanding before applying this maxBytes, and the native image-injection path uses the separate 6 MB MAX_IMAGE_BYTES limit. As a result, 6–10 MB Discord images can still be ignored despite this config saying 10 MB per image; either align the native limit/config path or use an explicit media-understanding model path that honors this setting.
        maxBytes: 10485760, // 10 MB per image

config/openclaw.prod.json5:443

  • This attachment policy only affects the media-understanding runner. For vision-capable active models, image understanding is skipped and the later native image-injection path loads image references from the media note without using tools.media.image.attachments, so messages with more than 5 Discord images can still bypass this cap. Please apply the same limit to native image injection or configure a non-native media-understanding model path if this cap is required.
        attachments: {
          mode: "all",       // "all" = process all attached images
          maxAttachments: 5, // max images per message

Comment on lines +434 to +438
// Enables Discord image attachments to be processed by the agent
// Refs: Piboonsak/Openclaw#506 (bug: NongKung ไม่เห็นรูปภาพที่แนบใน Discord message)
media: {
image: {
enabled: true,
maxBytes: 10485760, // 10 MB per image
timeoutSeconds: 30,
attachments: {
mode: "all", // "all" = process all attached images

@Piboonsak Piboonsak left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@Piboonsak
Piboonsak merged commit 2b4b20c into main May 16, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants