openclaw - 💡(How to fix) Fix [Feature]: Make non-image webchat attachment handling configurable (PDF offload, text inline) [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#70438Fetched 2026-04-23 07:24:49
View on GitHub
Comments
0
Participants
1
Timeline
0
Reactions
0
Author
Participants

We were previously carrying a local patch that implemented exactly the behavior above by editing dist/attachment-normalize-*.js and the control-ui bundle. We've retired that patch after 2026.4.21 changed bundle filenames and restructured the control-ui file-input filter target — specifically, the minified H_/U_ file-input filter block no longer exists in index-*.js. Rather than keep chasing minified diffs across upstream revisions, we'd prefer an officially supported config knob.

Root Cause

We were previously carrying a local patch that implemented exactly the behavior above by editing dist/attachment-normalize-*.js and the control-ui bundle. We've retired that patch after 2026.4.21 changed bundle filenames and restructured the control-ui file-input filter target — specifically, the minified H_/U_ file-input filter block no longer exists in index-*.js. Rather than keep chasing minified diffs across upstream revisions, we'd prefer an officially supported config knob.

Fix Action

Fix / Workaround

We were previously carrying a local patch that implemented exactly the behavior above by editing dist/attachment-normalize-*.js and the control-ui bundle. We've retired that patch after 2026.4.21 changed bundle filenames and restructured the control-ui file-input filter target — specifically, the minified H_/U_ file-input filter block no longer exists in index-*.js. Rather than keep chasing minified diffs across upstream revisions, we'd prefer an officially supported config knob.

Code Example

webchat:
  attachments:
    pdf: offload     # drop | offload
    text_inline: true
    max_inline_text_chars: 200000
RAW_BUFFERClick to expand / collapse

Ask

Add a webchat.attachments config (or per-tenant knob) controlling how non-image uploads are handled, rather than silently dropping them in attachment-normalize.

Proposed defaults (configurable):

  • image/* → existing inline-or-offload path (unchanged)
  • application/pdf → offload and inject [media attached: media://inbound/<id>] into the user message so the agent sees the reference
  • text/*, application/json, application/xml, application/x-yaml, CSV/TSV, common code MIME types → decode as UTF-8 and inline as a fenced code block, capped at a configurable max_inline_text_chars (~200 KB is a reasonable default)
  • everything else → drop (current behavior)

All three can live under one config key:

webchat:
  attachments:
    pdf: offload     # drop | offload
    text_inline: true
    max_inline_text_chars: 200000

Why

Today anything that isn't an image is silently swallowed by the gateway's attachment-normalize-*.js stage before it reaches the agent. Users see the upload succeed in the UI with no feedback that the content was discarded.

Related

  • #60226 Non-image file attachments (PDF/Word/etc) not injected into agent context
  • #30759 [Feature]: WebChat file upload support for documents (PDF, Word, TXT)
  • #50337 Web UI: File upload only accepts images, not PDF/Word documents
  • #58543 [Control UI] Support inline image/media attachments in webchat chat messages

Context

We were previously carrying a local patch that implemented exactly the behavior above by editing dist/attachment-normalize-*.js and the control-ui bundle. We've retired that patch after 2026.4.21 changed bundle filenames and restructured the control-ui file-input filter target — specifically, the minified H_/U_ file-input filter block no longer exists in index-*.js. Rather than keep chasing minified diffs across upstream revisions, we'd prefer an officially supported config knob.

Env

  • [email protected]
  • Deployment: self-hosted, npm global install, multi-tenant (two user-unit gateways on one host)

extent analysis

TL;DR

Implement a webchat.attachments config to control how non-image uploads are handled, allowing for offloading and inlining of specific file types.

Guidance

  • Introduce a webchat.attachments config with options for pdf, text_inline, and max_inline_text_chars to handle non-image uploads.
  • Set pdf to offload to inject a reference to the uploaded PDF into the user message.
  • Set text_inline to true to decode and inline text files as fenced code blocks, up to a configurable character limit.
  • Test the new config by uploading different file types and verifying the expected behavior.

Example

webchat:
  attachments:
    pdf: offload
    text_inline: true
    max_inline_text_chars: 200000

Notes

This solution assumes that the webchat.attachments config will be officially supported in future versions of openclaw. If this is not the case, a custom patch or workaround may still be necessary.

Recommendation

Apply the proposed webchat.attachments config to control non-image uploads, as it provides a flexible and configurable solution for handling different file types.

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 [Feature]: Make non-image webchat attachment handling configurable (PDF offload, text inline) [1 participants]