You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This pull request introduces support for additional media file types and improves how different media responses are delivered. The main changes are the expansion of recognized media file extensions and the addition of logic to handle video and audio file sending separately.
Kept:.pdf in MEDIA: tag extraction (shipped in #13683 — #13683).
Left out:.ogg in _LOCAL_MEDIA_EXTS and the audio/video routing in _deliver_media_from_response. Two reasons:
_LOCAL_MEDIA_EXTS drives extract_local_files(), which auto-sends any bare path the agent mentions. That's fine for images/videos (agents rarely write those inline as status text) but risky for audio/PDFs — the model routinely mentions file paths as status ("I saved the report to /tmp/out.pdf") without intending to deliver them. Making MEDIA: the explicit opt-in keeps that boundary clean.
The audio send_voice routing already landed on main in ed76185 (send_voice override) + the existing _AUDIO_EXTS branches in gateway/platforms/base.py and gateway/run.py for MEDIA:-tagged audio. The .ogg case your PR targeted flows through that path already when the agent uses MEDIA:.
So: agents wanting to deliver a PDF now emit MEDIA:/path/to/file.pdf and it goes through as a native attachment. Same for audio, which already worked via MEDIA: on main. Closing this one — PDF gap is fixed, and the other changes would open the bare-path surface wider than we want right now.
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
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.
What does this PR do?
This pull request introduces support for additional media file types and improves how different media responses are delivered. The main changes are the expansion of recognized media file extensions and the addition of logic to handle video and audio file sending separately.
Related Issue
#9236
#4979
Fixes #
Type of Change
Changes Made
Media type support and delivery improvements:
Added
.oggand.pdfto the list of recognized local media file extensions ingateway/platforms/base.pyto support more file types.Enhanced the media delivery logic in
gateway/run.pyto:send_videofor file extensions in_VIDEO_EXTS.send_voicefor file extensions in_AUDIO_EXTS.How to Test
Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/A