hermes - 💡(How to fix) Fix [Bug]: MEDIA tag from stale tool output in session history leaks into later text-only responses [2 pull requests]

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…

Root Cause

  • The user receives an image with zero context (e.g., an article cover attached to a message about a skill version bump)
  • This breaks trust — the user has to stop and ask "why did you send me this?"
  • The behavior is non-deterministic from the user's perspective: whether a stale image gets attached depends on what tools ran earlier in the session

Fix Action

Fixed

Code Example

15:22:19 response ready: platform=telegram chat=144447481 time=175.1s api_calls=2 response=539 chars
15:22:19 [Telegram] Sending response (495 chars) to 144447481
15:22:19 [Telegram] Sending media group of 1 photo(s) (chunk 1/1)
RAW_BUFFERClick to expand / collapse

Bug description

After upgrading to v0.15.1 (2026.5.29), the Telegram gateway attaches images from previous tool outputs in the same session to later text-only assistant responses that contain no MEDIA tags.

Steps to reproduce

  1. Run an execute_code block that generates an image and prints MEDIA:/tmp/example.png in its stdout (e.g., a FAL cover image generation via make_image)
  2. Several conversation turns later, send a plain text response with zero MEDIA directives
  3. Observe: the gateway sends "Sending media group of 1 photo(s)" alongside the text, attaching the image from step 1

Evidence from logs (v0.15.1, Telegram)

15:22:19 response ready: platform=telegram chat=144447481 time=175.1s api_calls=2 response=539 chars
15:22:19 [Telegram] Sending response (495 chars) to 144447481
15:22:19 [Telegram] Sending media group of 1 photo(s) (chunk 1/1)

The 539-char response was a plain text status update (skill version summary). No MEDIA directive was present in the assistant's message. The attached photo was /tmp/seosmi_cover.png — generated by a make_image block several turns earlier in the same session.

Hypothesis

After v0.15.1, the gateway scans all tool outputs in the session history for MEDIA tags when preparing a response, rather than only scanning the current assistant message. The file still exists on disk (/tmp/seosmi_cover.png was 2.3 MB, generated ~30 minutes earlier), so the gateway silently picks it up and sends it.

Why this matters

  • The user receives an image with zero context (e.g., an article cover attached to a message about a skill version bump)
  • This breaks trust — the user has to stop and ask "why did you send me this?"
  • The behavior is non-deterministic from the user's perspective: whether a stale image gets attached depends on what tools ran earlier in the session

Related

  • #14665 describes a similar MEDIA leak but through context compaction — this bug occurs without compaction
  • The stale execute_code stdout containing MEDIA:/tmp/seosmi_cover.png was present in the raw conversation messages as a tool role result

Environment

  • Hermes Agent v0.15.1 (2026.5.29)
  • Platform: Telegram (polling mode)
  • Python 3.11.15, Linux

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 [Bug]: MEDIA tag from stale tool output in session history leaks into later text-only responses [2 pull requests]