# NousResearch/hermes-agent · Image attachment routing and format validation fixes

## Open now

- Nothing open on GitHub.

Multiple fixes addressing incorrect routing of non-image attachments as images in Discord and Telegram gateways, plus validation and transcoding of image formats before sending to vision/responses APIs. Includes magic-byte MIME sniffing and handling of unsupported image formats.

## TL;DR

- 10 member(s): 0 open issue(s), 3 closed issue(s), 0 open PR(s), 2 merged PR(s), 5 PR(s) closed without merging.
- A fix was merged to main in PR #53923. Verify it addresses your case.
- **Recommended:** read PR #53923 (and any competing PRs below) before filing. Confirm the merged change covers your symptom.

## Maintainer resolution verdict

- Internal-tracker verdict over this cluster's issue members: `partially_resolved` · deciding PR(s): `pr-53923,pr-115811`. This is distinct from the fix status above. Weigh it yourself.

## How this cluster was grouped

- Link evidence (`STRUCTURAL_PARTIAL`): some members are connected by structural evidence (shared changed files, or a closing/superseded reference); the rest are joined by an automated relevance judgement over their text.
- Members outside that structural core may belong to a different underlying problem.
- Pairwise link density `0.18`: the share of member pairs that carry a link, counting a structural link in full and a relevance-only link at 0.36. `1.00` means every pair is linked.

## Closed / duplicate issues

- #25935: Discord image attachments fail with HTTP 400 'Could not process image' when mixed with documents, or when format isn't PNG/JPEG/GIF/WEBP
- #29711: Discord mixed attachments can send non-image data URLs as input_image, causing Responses 400 invalid image
- #50793: Discord gateway routes non-image attachments as images and lacks graceful large-video fallback

## Prior & competing PRs

- **#29752: fix(codex-responses): drop mismatched data:image input parts (#29711)**. closed without merge · fix tier `suggested`
  - maintainer direction: category `implemented_elsewhere`; implication `superseded`
  - _suggested-tier fix detail withheld; re-request with `?tier=all` to include it._
- **#29848: fix: validate magic bytes on data:image URLs before sending to Vision providers (issue #29711)**. closed without merge · fix tier `suggested`
  - maintainer direction: category `uncategorized`; implication `needs_llm`; refs `505bc27d8`
- **#53923: fix(gateway): classify mixed attachments per-attachment + transcode uncommon image formats**. merged to main · fix tier `verified`
  - maintainer direction: category `merged`; implication `superseded`
  - files: `agent/image_routing.py`, `gateway/run.py`, `scripts/release.py`, `tests/agent/test_image_routing.py`, `tests/gateway/test_mixed_attachment_routing.py`
- **#115811: fix(codex): an unsupported inline image (SVG) no longer 400s the whole Responses request or wedges the session (#29711, salvage #47299)**. merged to main · fix tier `verified`
  - maintainer direction: category `merged`; implication `superseded`
  - files: `agent/anthropic_message_convert.py`, `agent/codex_responses_adapter.py`, `tests/agent/test_anthropic_adapter.py`, `tests/agent/test_codex_responses_adapter.py`, `tools/vision_tools_image_prep.py`, `website/docs/user-guide/features/vision.md`
- **#25936: fix(gateway,image-routing): stop cross-routing docs as images + transcode uncommon formats**. closed without merge
  - maintainer direction: category `merged_via`; implication `superseded`; refs `#53923`
- **#26409: fix(gateway): keep Discord docs out of photo vision routing**. closed without merge
  - maintainer direction: category `merged_via`; implication `superseded`; refs `#53923`
- **#47299: fix: downgrade unsupported Codex image data URLs**. closed without merge
  - maintainer direction: category `uncategorized`; implication `needs_llm`

## Fix status

- Merged to main in PR #53923 (cited above). No release data is tracked. Verify downstream.
- Fix last verified (merged) `2026-09-19`.
- Subsystem: `agent`
