Skip to content

fix: accept all document attachments#12468

Open
zesty-clawd wants to merge 2 commits into
NousResearch:mainfrom
zesty-clawd:fix/all-file-attachments
Open

fix: accept all document attachments#12468
zesty-clawd wants to merge 2 commits into
NousResearch:mainfrom
zesty-clawd:fix/all-file-attachments

Conversation

@zesty-clawd

Copy link
Copy Markdown

Bug Description

Discord/Telegram/Slack would skip non-whitelisted document extensions, so files like .json were treated as empty text-only messages.

Root Cause

Each platform adapter gated document handling on SUPPORTED_DOCUMENT_TYPES and rejected any extension not in the allowlist.

Fix

  • Treat any non-media upload as a document instead of skipping it
  • Fall back to the attachment MIME type or application/octet-stream for unknown files
  • Preserve text injection for common text-like formats, including JSON
  • Add regression tests for JSON and unknown-document handling

How to Verify

  1. Send a .json file in Discord and confirm it is cached as a document
  2. Send a document with no filename/mime in Telegram and confirm it is still cached
  3. Run the gateway document tests

Test Plan

  • Added regression test for this bug
  • Existing tests still pass
  • Manual verification of the fix

Risk Assessment

Low — the change only broadens document acceptance and keeps existing media handling unchanged.

Treat non-media Discord, Telegram, and Slack uploads as documents instead of skipping unsupported extensions.

- Cache unknown file types with a safe fallback MIME type
- Preserve plain-text injection for common text-like formats
- Add regression tests for JSON and unnamed uploads
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery platform/discord Discord bot adapter platform/telegram Telegram bot adapter platform/slack Slack app adapter labels Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists platform/discord Discord bot adapter platform/slack Slack app adapter platform/telegram Telegram bot adapter type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants