fix(gateway): restrict auto-appended media to producer tools - #16721
Closed
VinciZhu wants to merge 1 commit into
Closed
fix(gateway): restrict auto-appended media to producer tools#16721VinciZhu wants to merge 1 commit into
VinciZhu wants to merge 1 commit into
Conversation
VinciZhu
force-pushed
the
fix/gateway-media-auto-append-tool-allowlist
branch
from
April 28, 2026 00:28
c6108a5 to
ee6ee3a
Compare
Collaborator
|
Thanks @VinciZhu — salvaged into a batch PR alongside another related Your producer-tool allowlist commit was cherry-picked with authorship preserved. Since Closing in favor of #36275. |
13 tasks
kshitijk4poor
added a commit
to kshitijk4poor/hermes-agent
that referenced
this pull request
Jun 1, 2026
kshitijk4poor
added a commit
that referenced
this pull request
Jun 1, 2026
alt-glitch
pushed a commit
that referenced
this pull request
Jun 14, 2026
kossteg
pushed a commit
to kossteg/hermes-agent
that referenced
this pull request
Jun 16, 2026
T02200059
pushed a commit
to T02200059/hermes-agent
that referenced
this pull request
Jun 18, 2026
xyshanren
pushed a commit
to xyshanren/hermes-agent-cn
that referenced
this pull request
Jun 25, 2026
waefrebeorn
pushed a commit
to waefrebeorn/slermes
that referenced
this pull request
Jul 2, 2026
5 tasks
santhreal
pushed a commit
to santhreal/hermes-agent
that referenced
this pull request
Jul 13, 2026
donbowman
pushed a commit
to donbowman/hermes-agent
that referenced
this pull request
Jul 13, 2026
Gravezzz
pushed a commit
to Gravezzz/hermes-agent
that referenced
this pull request
Jul 21, 2026
leewenjie
pushed a commit
to leewenjie/hermes-agent
that referenced
this pull request
Aug 7, 2026
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
This PR prevents the gateway from auto-appending
MEDIA:tags found in arbitrary tool results.Previously, when the final response did not contain a media tag, the gateway scanned all current-turn tool/function output for
MEDIA:strings and appended any matches to the final gateway reply. That is too broad: ordinary tools can return documentation, skill content, logs, search results, or user-authored text containing literal media examples.For example, a docs/skill tool can legitimately return:
That string is only documentation, but the old broad scanner treats it as a real attachment and may try to send a nonexistent file on any gateway platform.
The fix keeps the behavior intentionally narrow: automatic append only considers tool outputs from known media-producing tools (
text_to_speechand the legacytext_to_speech_toolname). Future media-producing tools can opt in deliberately by adding their tool name to this list or by introducing a registry-level capability flag.Fixes #16720
Changes
Test plan
skill_viewoutput containing aMEDIA:example is not auto-appended.text_to_speechmedia output is still auto-appended, including the voice directive.Result:
Follow-up note
This PR intentionally avoids changing tool registration APIs. If maintainers prefer a more extensible design, the allowlist can be replaced in a follow-up with a registry-level capability flag such as
auto_append_media=Trueon media-producing tools.