# NousResearch/hermes-agent · MEDIA tag leaking into message output, fixes

## Open now

- Nothing open on GitHub.

A bug where MEDIA: directives and \[\[audio_as_voice\]\] tags were leaking into visible message output, along with multiple fix attempts addressing stripping these tags from streamed and gateway messages.

## TL;DR

- 3 member(s): 0 open issue(s), 1 closed issue(s), 0 open PR(s), 1 merged PR(s), 1 PR(s) closed without merging.
- A fix was merged to main in PR #1642. Verify it addresses your case.
- **Recommended:** read PR #1642 (and any competing PRs below) before filing. Confirm the merged change covers your symptom.

## Maintainer resolution verdict

- Internal-tracker verdict over this cluster's issue members: `resolved` · deciding PR(s): `pr-1642`. This is distinct from the fix status above. Weigh it yourself.

## How this cluster was grouped

- Link evidence (`STRUCTURAL_SPANNING`): every member is connected by structural evidence: shared changed files, or a closing/superseded reference.
- Pairwise link density `0.67`: the share of member pairs that carry a link, counting a structural link in full and a relevance-only link at 0.36. `1.00` means every pair is linked.

## Closed / duplicate issues

- #1561: \[Bug\] MEDIA: and \[\[audio_as_voice\]\] tags leaking into message output

## Prior & competing PRs

- **#1642: fix(gateway): strip MEDIA: and \[\[audio_as_voice\]\] tags from message body**. merged to main · fix tier `verified`
  - maintainer direction: category `merged`
  - files: `gateway/platforms/base.py`
  - fix hunks:
  - `gateway/platforms/base.py`

    ```diff
    @@ -840,6 +840,9 @@ async def _process_message_background(self, event: MessageEvent, session_key: st
                     
                     # Extract image URLs and send them as native platform attachments
                     images, text_content = self.extract_images(response)
    +                # Strip any remaining internal directives from message body (fixes #1561)
    +                text_content = text_content.replace("[[audio_as_voice]]", "").strip()
    +                text_content = re.sub(r"MEDIA:\s*\S+", "", text_content).strip()
                     if images:
                         logger.info("[%s] extract_images found %d image(s) in response (%d chars)", self.name, len(images), len(response))
                     
    ```
- **#1611: fix(gateway): strip MEDIA: and \[\[audio_as_voice\]\] tags from message body**. closed without merge
  - maintainer direction: category `merged_via`; implication `superseded`; refs `#1642`

## Fix status

- Merged to main in PR #1642 (cited above). No release data is tracked. Verify downstream.
- Fix last verified (merged) `2026-03-17`. This confirmation is old and may be out of date (a revert/reopen would not have invalidated it here); re-verify.
- Subsystem: `gateway`
