hermes - 💡(How to fix) Fix Generated images under cache/images may not deliver via Telegram MEDIA, while image_cache works

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…

Fix Action

Fix / Workaround

As a workaround, the same file was copied to the legacy cache root:

Code Example

/Users/hermes/.hermes/cache/images/openai_codex_gpt-image-2-medium_20260524_165209_f2f01ae4.png

---

MEDIA:/Users/hermes/.hermes/cache/images/openai_codex_gpt-image-2-medium_20260524_165209_f2f01ae4.png

---

/Users/hermes/.hermes/image_cache/system-ops-hermes-avatar.png

---

MEDIA:/Users/hermes/.hermes/image_cache/system-ops-hermes-avatar.png
RAW_BUFFERClick to expand / collapse

Bug Description

Generated images are saved under the newer Hermes cache path (~/.hermes/cache/images/...), but Telegram media delivery from a final gateway response did not deliver the image. Copying the exact same generated image into the legacy path (~/.hermes/image_cache/...) and sending it via MEDIA: worked immediately.

This looks like a cache-root mismatch/regression around image generation output paths vs the gateway media delivery pipeline/allowlist.

Observed Behavior

In a Telegram group chat, image_generate returned a local file path like:

/Users/hermes/.hermes/cache/images/openai_codex_gpt-image-2-medium_20260524_165209_f2f01ae4.png

The assistant final response included:

MEDIA:/Users/hermes/.hermes/cache/images/openai_codex_gpt-image-2-medium_20260524_165209_f2f01ae4.png

The user did not receive the image.

As a workaround, the same file was copied to the legacy cache root:

/Users/hermes/.hermes/image_cache/system-ops-hermes-avatar.png

Then sending:

MEDIA:/Users/hermes/.hermes/image_cache/system-ops-hermes-avatar.png

worked in the same Telegram chat.

Expected Behavior

Images generated by image_generate should be saved to, or normalized into, a gateway-deliverable media cache path. A MEDIA: tag pointing at a generated image should upload the image natively to Telegram without the agent needing to know which cache directory is currently deliverable.

Actual Behavior

image_generate produced a file under ~/.hermes/cache/images, but the Telegram user did not receive it when emitted in the final response. The legacy ~/.hermes/image_cache path did deliver.

Steps to Reproduce

  1. In a Telegram gateway session, call image_generate.
  2. Let the tool return a local path under ~/.hermes/cache/images/....
  3. Include that path in the final response as MEDIA:/absolute/path/to/generated.png.
  4. Observe that the image is not delivered to the user.
  5. Copy the file into ~/.hermes/image_cache/....
  6. Send the copied path via MEDIA:/absolute/path/to/copied.png.
  7. Observe that Telegram delivery succeeds.

Environment

  • Platform: Telegram group chat
  • Host OS: macOS
  • Hermes home: /Users/hermes/.hermes
  • Generated file path: ~/.hermes/cache/images/...
  • Working file path: ~/.hermes/image_cache/...
  • Provider/model for image generation in this instance: openai-codex / gpt-image-2-medium

Related Issues

  • #6249: Telegram MEDIA image delivery can echo local file path as text instead of uploading attachment
  • #26942: image_gen + video_gen ephemeral URL issue; proposes caching generated images into image_cache

This issue is more specific: the image is already a local file, but the generated local cache path (cache/images) does not behave like the legacy deliverable path (image_cache) for Telegram delivery from the final response.

Possible Fix Direction

Unify generated media output with the gateway's validated/deliverable media roots. Options:

  1. Have image_generate write/copy generated images into the same deliverable cache root used by Telegram (image_cache or the canonical equivalent).
  2. Normalize ~/.hermes/cache/images to a deliverable root during gateway MEDIA: extraction/validation.
  3. Add a regression test that a generated image path under the current image-generation cache can be delivered through the Telegram media pipeline, not only the legacy image_cache path.

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

hermes - 💡(How to fix) Fix Generated images under cache/images may not deliver via Telegram MEDIA, while image_cache works