openclaw - 💡(How to fix) Fix [Feature] DEFAULT_MAX_ATTACHMENTS = 1 prevents multi-image analysis (Anthropic accepts up to 20) [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#72194Fetched 2026-04-27 05:33:35
View on GitHub
Comments
1
Participants
2
Timeline
2
Reactions
0
Timeline (top)
closed ×1commented ×1

Fix Action

Fix / Workaround

Current Workaround

We sed-patch the bundled JS via cron (@reboot + */15) to raise the default to 5, which covers our typical use. The patch is idempotent and survives container restarts, but breaks on every npm install -g openclaw upgrade.

Code Example

{
  "messages": {
    "image": {
      "maxAttachments": 10
    }
  }
}
RAW_BUFFERClick to expand / collapse

Problem

DEFAULT_MAX_ATTACHMENTS = 1 in dist/pi-embedded-*.js blocks any workflow that needs multiple images in one turn:

  • Comparing two product photos / two contract pages side-by-side
  • Sending a multi-page screenshot set of a PDF
  • Submitting front + back of an ID document for joint analysis
  • Multi-frame visual reasoning

The upstream Anthropic Messages API supports up to 20 image content blocks per request for Claude 3.5+ and 4.x; OpenAI Vision has a similar high cap. So the gating is purely a client-side default.

Current Workaround

We sed-patch the bundled JS via cron (@reboot + */15) to raise the default to 5, which covers our typical use. The patch is idempotent and survives container restarts, but breaks on every npm install -g openclaw upgrade.

Proposed Solution

Raise the default to something realistic (e.g. 5 or 10) and/or expose it via openclaw.json:

{
  "messages": {
    "image": {
      "maxAttachments": 10
    }
  }
}

Environment

  • OpenClaw 2026.4.24 (commit cbcfdf6)
  • Telegram channel
  • Claude Opus 4.x via anthropic-new
  • Constant in dist/pi-embedded-*.js

Thanks!

extent analysis

TL;DR

Raise the DEFAULT_MAX_ATTACHMENTS value in dist/pi-embedded-*.js or expose it via openclaw.json to increase the maximum allowed attachments.

Guidance

  • Review the proposed solution to raise the default to a realistic value (e.g., 5 or 10) and consider exposing it via openclaw.json for easier configuration.
  • Verify that the Anthropic Messages API version (Claude 3.5+ or 4.x) supports the desired number of image content blocks per request.
  • Test the workaround by updating the openclaw.json file with the proposed configuration and check if it resolves the issue without breaking on npm install -g openclaw upgrades.
  • Consider the trade-offs between raising the default value and exposing it via configuration, taking into account the specific use cases and requirements.

Example

{
  "messages": {
    "image": {
      "maxAttachments": 10
    }
  }
}

This example shows how to expose the maxAttachments value via openclaw.json.

Notes

The solution may not be applicable if the Anthropic Messages API version does not support the desired number of image content blocks per request. Additionally, the openclaw.json configuration may not be supported in all versions of OpenClaw.

Recommendation

Apply the workaround by exposing the maxAttachments value via openclaw.json, as it provides a more flexible and configurable solution. This approach allows for easier updates and adjustments to the maximum allowed attachments without requiring modifications to the bundled JS code.

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