Hermes Media Carry

The last line holds the picture.
If a tool rendered an image and the model forgot to paste the
MEDIA:line, Media Carry appends that exact line so the file is shown.TOOL REPORTS IT · THE REPLY KEEPS IT · NOTHING IS INVENTED
The problem
A local model renders an image, writes a careful analysis, and ends the reply
without the MEDIA:/path/to/file.png line the tool told it to paste. Desktop,
the phone UI and the API only render a MEDIA: line that appears in the
assistant text. A tool result alone is not shown, so the picture vanishes.
The solution
Media Carry is a tiny, boring hook plugin:
post_tool_callrecordsMEDIA:paths printed by tools this turn, but
only when the file exists on disk and is fresh (default: newer than 6 hours).transform_llm_outputappends the newest missing path as the reply's
last line if the model forgot it. If the reply already contains the path,
nothing changes.- Reader tools are ignored (skills,
read_*, search, memory,web_*,
browser, and similar prefixes). A skill that quotes an exampleMEDIA:line
must not attach a file the turn never produced. - Shell and MCP output is confined. A
terminalormcp_*result can name
any file, so itsMEDIA:paths are carried only when they resolve (symlinks
and..included) into Hermes' own media cache folders or a folder you list
inmedia_roots. A command that merely prints a private image's path cannot
post it into a shared chat. - Bounded scan. The
MEDIA:scan is a single linear pass, paths are capped
at 1024 characters, and a result with more than 50MEDIA:markers is
treated as a listing and skipped, so a huge fetched page cannot stall the
tool loop. - Never invents paths. There is no guessing, no directory scan, no network
and no model call. Pure Python stdlib.
If a turn rendered more than once, only the newest missing path is appended.
Dashboard

Open Media Carry in the Hermes dashboard (hermes dashboard). The hooks
run in the gateway / TUI process and the dashboard in its own web process, so
the hooks write their counters to the active profile's
plugin-data/media-carry/events.json and the page reads that file:
- Status: how many replies were carried, how many already had the line,
how many paths were skipped (reader tool, stale file, missing file), and
how many shell / MCP paths were outside the media folders. - Configuration: reader and confined prefixes, extra media folders, max
age and pending-turn cap. - Recent events: basenames only — full paths stay out of the UI.
- Controls: Refresh status and Simulate forgotten MEDIA (a dry run
of the real hooks in a temporary folder that is always deleted; it is never
counted). The page has no destructive actions.
Install
hermes plugins install https://github.com/noblebrown-69/hermes-media-carry --enable
Then restart the session or start a new one so the hooks are picked up.
Configuration
Settings live under plugins.entries.media-carry.settings in your profile's
config.yaml (or the Desktop Settings → Plugins → Media Carry form):
plugins:
entries:
media-carry:
enabled: true
settings:
reader_prefixes: [skill, read_, search, session_, memory, web_, browser, fact, todo]
confined_prefixes: [terminal, mcp_] # [] turns the folder check off
media_roots: [] # e.g. [~/renders] for a render script run from the shell
max_age_seconds: 21600 # 6 hours
max_keys: 200 # pending (session, turn) cap
Dashboard API
Mounted at /api/plugins/media-carry/ behind dashboard auth: GET /overview,
POST /test (temporary folder only, always cleaned up), GET /banner,
GET /health.
Security model
- Hooks only read tool results and the final reply text. The only thing they
write isplugin-data/media-carry/events.jsonin the active profile:
counters plus the last 50 events (action, reason, file basename, time). No
full paths, no session ids, no reply text. terminalandmcp_*results are confined to Hermes' media cache folders
plusmedia_roots; paths are resolved withrealpathbefore the check.- A path is used only when it appeared in a tool result this turn, the file
exists, and its modification time is withinmax_age_seconds. - The dashboard overview is read-only. The test endpoint is a dry run: it
creates a file in aTemporaryDirectory, removes the directory before
returning, and writes nothing toevents.json. - Platforms: linux and macos (paths are absolute POSIX paths).
Develop
python3 -m unittest discover -s tests -v # hook tests are stdlib-only
# dashboard route tests need FastAPI (the Hermes venv has it)
scripts/scrub-check.sh
hermes plugins validate --install-deps .
License
MIT. See LICENSE.
README from the reviewed commit 8c5cb66; it updates when the author re-pins.

noblebrown-69

