Skip to content

fix(gateway): preserve spaced unicode media paths from tool output#26407

Open
aqilaziz wants to merge 3 commits into
NousResearch:mainfrom
aqilaziz:fix/media-tags-unicode-spaces
Open

fix(gateway): preserve spaced unicode media paths from tool output#26407
aqilaziz wants to merge 3 commits into
NousResearch:mainfrom
aqilaziz:fix/media-tags-unicode-spaces

Conversation

@aqilaziz

@aqilaziz aqilaziz commented May 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Addresses the novel MEDIA extraction part of #26355: gateway tool-output scanning now preserves local media paths that contain spaces and non-ASCII filenames instead of truncating them with MEDIA:(\S+).

Changes

  • Reuse BasePlatformAdapter.extract_media() when scanning persisted tool output for MEDIA paths.
  • Apply the same extraction to history de-duplication and current-turn media forwarding.
  • Add a regression test for a Cyrillic .ogg filename with a space inside a JSON tool result.

Addresses #26355 (Bug 1: Cyrillic/spaced MEDIA paths lost during extraction)

Tests

  • python -m pytest -o addopts= tests\gateway\test_media_extraction.py tests\gateway\test_platform_base.py::TestExtractMedia tests\gateway\test_tts_media_routing.py -q --tb=short
  • python -m ruff check gateway\run.py tests\gateway\test_media_extraction.py
  • git diff --check

@alt-glitch alt-glitch added type/bug Something isn't working comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists labels May 15, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Related to the MEDIA path parsing cluster: #24132, #24384, #24217, #26368 (same author), #12179. Multiple competing PRs fix the \S+ regex truncation on spaced/Unicode paths.

@aqilaziz aqilaziz force-pushed the fix/media-tags-unicode-spaces branch from 55ff5f7 to 76d6c5b Compare May 15, 2026 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants