fix(gateway): preserve MEDIA delivery on queued follow-up responses (salvage #71031) - #82162
Merged
Merged
Conversation
Ensure queued follow-up resends keep MEDIA-backed attachments by replaying the first response through the gateway's text-plus-media delivery flow instead of a plain adapter text send.
MEDIA:/tmp paths are filtered by delivery safe roots; mirror other tests by placing the fixture under an allowed cache directory.
Drop the broad MEDIA: regex after extract_media so code/inline examples survive, and cover the real queued first-response resend path in tests.
… delivery
Adds the failed-result guard the salvage review called for:
_deliver_queued_first_response now takes deliver_media and the queued
follow-up call site passes deliver_media=not _delivery_result.get('failed').
A failed turn still delivers its normalized failure text (pinned by
test_run_agent_sends_normalized_failure_before_queued_followup), but its
attachments are no longer uploaded as if the turn succeeded — mirroring
the completed-turn path's 'not agent_result.get(failed)' guard.
Regression test added.
૮ >ﻌ< ა ci reviewran on 00c6c07
|
This was referenced Aug 9, 2026
4 tasks done
vKongv
added a commit
to pebble-tech/hermes-agent
that referenced
this pull request
Sep 6, 2026
NousResearch#25119, NousResearch#85355, and NousResearch#90058 closed without merge. Tekium salvage PRs NousResearch#82162, NousResearch#101247, and NousResearch#101242 cover those gaps on upstream main.
vKongv
added a commit
to pebble-tech/hermes-agent
that referenced
this pull request
Sep 6, 2026
NousResearch#25119, NousResearch#85355, and NousResearch#90058 closed without merge. Tekium salvage PRs NousResearch#82162, NousResearch#101247, and NousResearch#101242 cover those gaps on upstream main.
vKongv
added a commit
to pebble-tech/hermes-agent
that referenced
this pull request
Sep 6, 2026
NousResearch#25119, NousResearch#85355, and NousResearch#90058 closed without merge. Tekium salvage PRs NousResearch#82162, NousResearch#101247, and NousResearch#101242 cover those gaps on upstream main.
cursor Bot
pushed a commit
to pebble-tech/hermes-agent
that referenced
this pull request
Sep 7, 2026
NousResearch#25119, NousResearch#85355, and NousResearch#90058 closed without merge. Tekium salvage PRs NousResearch#82162, NousResearch#101247, and NousResearch#101242 cover those gaps on upstream main.
vKongv
added a commit
to pebble-tech/hermes-agent
that referenced
this pull request
Sep 9, 2026
NousResearch#25119, NousResearch#85355, and NousResearch#90058 closed without merge. Tekium salvage PRs NousResearch#82162, NousResearch#101247, and NousResearch#101242 cover those gaps on upstream main.
vKongv
added a commit
to pebble-tech/hermes-agent
that referenced
this pull request
Sep 9, 2026
NousResearch#25119, NousResearch#85355, and NousResearch#90058 closed without merge. Tekium salvage PRs NousResearch#82162, NousResearch#101247, and NousResearch#101242 cover those gaps on upstream main.
cursor Bot
pushed a commit
to pebble-tech/hermes-agent
that referenced
this pull request
Sep 21, 2026
NousResearch#25119, NousResearch#85355, and NousResearch#90058 closed without merge. Tekium salvage PRs NousResearch#82162, NousResearch#101247, and NousResearch#101242 cover those gaps on upstream main.
cursor Bot
pushed a commit
to pebble-tech/hermes-agent
that referenced
this pull request
Sep 22, 2026
NousResearch#25119, NousResearch#85355, and NousResearch#90058 closed without merge. Tekium salvage PRs NousResearch#82162, NousResearch#101247, and NousResearch#101242 cover those gaps on upstream main.
cursor Bot
pushed a commit
to pebble-tech/hermes-agent
that referenced
this pull request
Sep 23, 2026
NousResearch#25119, NousResearch#85355, and NousResearch#90058 closed without merge. Tekium salvage PRs NousResearch#82162, NousResearch#101247, and NousResearch#101242 cover those gaps on upstream main.
vKongv
added a commit
to pebble-tech/hermes-agent
that referenced
this pull request
Sep 24, 2026
NousResearch#25119, NousResearch#85355, and NousResearch#90058 closed without merge. Tekium salvage PRs NousResearch#82162, NousResearch#101247, and NousResearch#101242 cover those gaps on upstream main.
vKongv
added a commit
to pebble-tech/hermes-agent
that referenced
this pull request
Sep 24, 2026
NousResearch#25119, NousResearch#85355, and NousResearch#90058 closed without merge. Tekium salvage PRs NousResearch#82162, NousResearch#101247, and NousResearch#101242 cover those gaps on upstream main.
vKongv
added a commit
to pebble-tech/hermes-agent
that referenced
this pull request
Sep 24, 2026
NousResearch#25119, NousResearch#85355, and NousResearch#90058 closed without merge. Tekium salvage PRs NousResearch#82162, NousResearch#101247, and NousResearch#101242 cover those gaps on upstream main.
vKongv
added a commit
to pebble-tech/hermes-agent
that referenced
this pull request
Sep 24, 2026
NousResearch#25119, NousResearch#85355, and NousResearch#90058 closed without merge. Tekium salvage PRs NousResearch#82162, NousResearch#101247, and NousResearch#101242 cover those gaps on upstream main.
vKongv
added a commit
to pebble-tech/hermes-agent
that referenced
this pull request
Sep 24, 2026
NousResearch#25119, NousResearch#85355, and NousResearch#90058 closed without merge. Tekium salvage PRs NousResearch#82162, NousResearch#101247, and NousResearch#101242 cover those gaps on upstream main.
vKongv
added a commit
to pebble-tech/hermes-agent
that referenced
this pull request
Sep 24, 2026
NousResearch#25119, NousResearch#85355, and NousResearch#90058 closed without merge. Tekium salvage PRs NousResearch#82162, NousResearch#101247, and NousResearch#101242 cover those gaps on upstream main.
cursor Bot
pushed a commit
to pebble-tech/hermes-agent
that referenced
this pull request
Sep 27, 2026
NousResearch#25119, NousResearch#85355, and NousResearch#90058 closed without merge. Tekium salvage PRs NousResearch#82162, NousResearch#101247, and NousResearch#101242 cover those gaps on upstream main.
vKongv
added a commit
to pebble-tech/hermes-agent
that referenced
this pull request
Sep 28, 2026
NousResearch#25119, NousResearch#85355, and NousResearch#90058 closed without merge. Tekium salvage PRs NousResearch#82162, NousResearch#101247, and NousResearch#101242 cover those gaps on upstream main.
vKongv
added a commit
to pebble-tech/hermes-agent
that referenced
this pull request
Sep 28, 2026
NousResearch#25119, NousResearch#85355, and NousResearch#90058 closed without merge. Tekium salvage PRs NousResearch#82162, NousResearch#101247, and NousResearch#101242 cover those gaps on upstream main.
vKongv
added a commit
to pebble-tech/hermes-agent
that referenced
this pull request
Sep 28, 2026
NousResearch#25119, NousResearch#85355, and NousResearch#90058 closed without merge. Tekium salvage PRs NousResearch#82162, NousResearch#101247, and NousResearch#101242 cover those gaps on upstream main.
vKongv
added a commit
to pebble-tech/hermes-agent
that referenced
this pull request
Sep 28, 2026
NousResearch#25119, NousResearch#85355, and NousResearch#90058 closed without merge. Tekium salvage PRs NousResearch#82162, NousResearch#101247, and NousResearch#101242 cover those gaps on upstream main.
vKongv
added a commit
to pebble-tech/hermes-agent
that referenced
this pull request
Sep 28, 2026
NousResearch#25119, NousResearch#85355, and NousResearch#90058 closed without merge. Tekium salvage PRs NousResearch#82162, NousResearch#101247, and NousResearch#101242 cover those gaps on upstream main.
vKongv
added a commit
to pebble-tech/hermes-agent
that referenced
this pull request
Sep 28, 2026
NousResearch#25119, NousResearch#85355, and NousResearch#90058 closed without merge. Tekium salvage PRs NousResearch#82162, NousResearch#101247, and NousResearch#101242 cover those gaps on upstream main.
vKongv
added a commit
to pebble-tech/hermes-agent
that referenced
this pull request
Sep 29, 2026
NousResearch#25119, NousResearch#85355, and NousResearch#90058 closed without merge. Tekium salvage PRs NousResearch#82162, NousResearch#101247, and NousResearch#101242 cover those gaps on upstream main.
vKongv
added a commit
to pebble-tech/hermes-agent
that referenced
this pull request
Sep 29, 2026
NousResearch#25119, NousResearch#85355, and NousResearch#90058 closed without merge. Tekium salvage PRs NousResearch#82162, NousResearch#101247, and NousResearch#101242 cover those gaps on upstream main.
vKongv
added a commit
to pebble-tech/hermes-agent
that referenced
this pull request
Sep 29, 2026
NousResearch#25119, NousResearch#85355, and NousResearch#90058 closed without merge. Tekium salvage PRs NousResearch#82162, NousResearch#101247, and NousResearch#101242 cover those gaps on upstream main.
vKongv
added a commit
to pebble-tech/hermes-agent
that referenced
this pull request
Sep 29, 2026
NousResearch#25119, NousResearch#85355, and NousResearch#90058 closed without merge. Tekium salvage PRs NousResearch#82162, NousResearch#101247, and NousResearch#101242 cover those gaps on upstream main.
vKongv
added a commit
to pebble-tech/hermes-agent
that referenced
this pull request
Sep 29, 2026
NousResearch#25119, NousResearch#85355, and NousResearch#90058 closed without merge. Tekium salvage PRs NousResearch#82162, NousResearch#101247, and NousResearch#101242 cover those gaps on upstream main.
vKongv
added a commit
to pebble-tech/hermes-agent
that referenced
this pull request
Sep 29, 2026
NousResearch#25119, NousResearch#85355, and NousResearch#90058 closed without merge. Tekium salvage PRs NousResearch#82162, NousResearch#101247, and NousResearch#101242 cover those gaps on upstream main.
vKongv
added a commit
to pebble-tech/hermes-agent
that referenced
this pull request
Sep 30, 2026
NousResearch#25119, NousResearch#85355, and NousResearch#90058 closed without merge. Tekium salvage PRs NousResearch#82162, NousResearch#101247, and NousResearch#101242 cover those gaps on upstream main.
vKongv
added a commit
to pebble-tech/hermes-agent
that referenced
this pull request
Sep 30, 2026
NousResearch#25119, NousResearch#85355, and NousResearch#90058 closed without merge. Tekium salvage PRs NousResearch#82162, NousResearch#101247, and NousResearch#101242 cover those gaps on upstream main.
vKongv
added a commit
to pebble-tech/hermes-agent
that referenced
this pull request
Sep 30, 2026
NousResearch#25119, NousResearch#85355, and NousResearch#90058 closed without merge. Tekium salvage PRs NousResearch#82162, NousResearch#101247, and NousResearch#101242 cover those gaps on upstream main.
vKongv
added a commit
to pebble-tech/hermes-agent
that referenced
this pull request
Sep 30, 2026
NousResearch#25119, NousResearch#85355, and NousResearch#90058 closed without merge. Tekium salvage PRs NousResearch#82162, NousResearch#101247, and NousResearch#101242 cover those gaps on upstream main.
vKongv
added a commit
to pebble-tech/hermes-agent
that referenced
this pull request
Sep 30, 2026
NousResearch#25119, NousResearch#85355, and NousResearch#90058 closed without merge. Tekium salvage PRs NousResearch#82162, NousResearch#101247, and NousResearch#101242 cover those gaps on upstream main.
vKongv
added a commit
to pebble-tech/hermes-agent
that referenced
this pull request
Sep 30, 2026
NousResearch#25119, NousResearch#85355, and NousResearch#90058 closed without merge. Tekium salvage PRs NousResearch#82162, NousResearch#101247, and NousResearch#101242 cover those gaps on upstream main.
vKongv
added a commit
to pebble-tech/hermes-agent
that referenced
this pull request
Oct 1, 2026
NousResearch#25119, NousResearch#85355, and NousResearch#90058 closed without merge. Tekium salvage PRs NousResearch#82162, NousResearch#101247, and NousResearch#101242 cover those gaps on upstream main.
vKongv
added a commit
to pebble-tech/hermes-agent
that referenced
this pull request
Oct 1, 2026
NousResearch#25119, NousResearch#85355, and NousResearch#90058 closed without merge. Tekium salvage PRs NousResearch#82162, NousResearch#101247, and NousResearch#101242 cover those gaps on upstream main.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Telegram (and every gateway platform) no longer leaks literal
MEDIA:/pathtext — or silently drops attachments — when a response is delivered through the queued follow-up path.Salvage of #71031 by @StellarisW (all 7 commits cherry-picked with authorship preserved; consolidates @vKongv's #25119 work, whose commits were already merged into the PR branch with attribution), plus a follow-up commit adding the failed-result guard from the salvage review.
Both bug branches verified at line level on main: when a message queues during an active run (interrupt-mode next-turn handoff, subagent/compression demotions, photo bursts, or queue mode), the first turn's response is delivered by a side path in
_run_agentthat bypassed MEDIA handling entirely — (1) non-streamed responses went out via rawadapter.send()with the literalMEDIA:tag as text and no file; (2) already-streamed responses logged "delivery confirmed" and silently dropped the attachments. Hermes told the user a file was produced; the file never arrived.Changes
gateway/run.py(contributor): new_deliver_queued_first_response()— splits text from attachments via the existingextract_media+_deliver_media_from_responsemachinery (path-security filtering and the explicit-only bug(gateway): post-stream media delivery can upload bare local paths not intentionally present in the visible reply #20834 policy preserved), covers both branches viatext_already_delivered, keeps thread/reply routing metadata, keeps protected`MEDIA:`examples and bare paths as visible text, applies the intentional-silence predicate.gateway/run.py(follow-up):deliver_media=not _delivery_result.get("failed")— a failed first turn still delivers its normalized failure text but never uploads its attachments, mirroring the completed-turn path's guard. Regression test added.Conflicts were confined to the two test files flagged in review (
test_run_progress_topics.py,test_tts_media_routing.py— neighboring tests added on main); productionrun.pychanges applied clean.Validation
MEDIA:/pathtext, no fileAfter merge: close #18546, #25119, #46223, #51805 as superseded (each covered only the fallback branch or violated the explicit-only policy); #56092 (duplicate re-send race) is orthogonal and stays open.
Infographic