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
Fixes .ics calendar invite delivery through the shared gateway media
extraction path.
Before this change, a response like MEDIA:/tmp/event.ics could remain visible
as literal text instead of being extracted and uploaded as a native document
attachment, because .ics was missing from the gateway document MIME map and
outbound media-delivery extension allowlist.
This is gateway-wide rather than Signal-specific: BasePlatformAdapter.extract_media()
runs before platform-specific dispatch, and non-image media is then routed
through send_document().
Related Issue
N/A — no issue was filed. Related prior closed PR: #33454.
Type of Change
🐛 Bug fix (non-breaking change that fixes an issue)
✨ New feature (non-breaking change that adds functionality)
🔒 Security fix
📝 Documentation update
✅ Tests (adding or improving test coverage)
♻️ Refactor (no behavior change)
🎯 New skill (bundled or hub)
Changes Made
gateway/platforms/base.py — adds .ics to SUPPORTED_DOCUMENT_TYPES as text/calendar.
gateway/platforms/base.py — adds .ics to MEDIA_DELIVERY_EXTS so calendar
files are extracted for document delivery.
tests/gateway/test_media_extraction.py — adds regression coverage for both
explicit MEDIA:/.../event.ics tags and bare local .ics paths.
How to Test
Create a local .ics file.
Have an agent response include MEDIA:/path/to/event.ics.
Verify the gateway extracts the file and sends it as a document attachment
instead of leaving the MEDIA: tag as visible text.
I also attempted the full suite with python3 -m pytest tests/ -q; it did not
complete in this checkout, timing out after 600s with failures outside the
targeted gateway extraction tests before reaching 40%.
Thanks for the focused regression fix. Current main still omits .ics from MEDIA_DELIVERY_EXTS at gateway/platforms/base.py:1455; that tuple builds MEDIA_TAG_CLEANUP_RE (:1478-1497), which extract_media() uses (:3641-3655), and also drives extract_local_files() (:3745-3755). The reported extraction failure therefore remains present.
The change adds .ics to that shared set and to SUPPORTED_DOCUMENT_TYPES, while the common response dispatcher sends extracted non-image/non-video files through send_document() (gateway/platforms/base.py:5110-5132). The added explicit-tag and real bare-file tests cover both affected extractor paths.
No correctness or completeness issue was found in the two-file diff. This is an automated hermes-sweeper review.
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
comp/gatewayGateway runner, session dispatch, deliveryP2Medium — degraded but workaround existssweeper:blast-containedSweeper blast radius: contained — one narrow path / opt-in / few userssweeper:risk-message-deliverySweeper risk: may drop, duplicate, misroute, or suppress messagestype/bugSomething isn't working
3 participants
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?
Fixes
.icscalendar invite delivery through the shared gateway mediaextraction path.
Before this change, a response like
MEDIA:/tmp/event.icscould remain visibleas literal text instead of being extracted and uploaded as a native document
attachment, because
.icswas missing from the gateway document MIME map andoutbound media-delivery extension allowlist.
This is gateway-wide rather than Signal-specific:
BasePlatformAdapter.extract_media()runs before platform-specific dispatch, and non-image media is then routed
through
send_document().Related Issue
N/A — no issue was filed. Related prior closed PR: #33454.
Type of Change
Changes Made
gateway/platforms/base.py— adds.icstoSUPPORTED_DOCUMENT_TYPESastext/calendar.gateway/platforms/base.py— adds.icstoMEDIA_DELIVERY_EXTSso calendarfiles are extracted for document delivery.
tests/gateway/test_media_extraction.py— adds regression coverage for bothexplicit
MEDIA:/.../event.icstags and bare local.icspaths.How to Test
.icsfile.MEDIA:/path/to/event.ics.instead of leaving the
MEDIA:tag as visible text.Verification run on this branch:
python3 -m pytest tests/gateway/test_media_extraction.py -q→ 11 passedpython3 scripts/check-windows-footguns.py gateway/platforms/base.py tests/gateway/test_media_extraction.py→ cleangit diff --check main..HEAD→ cleanI also attempted the full suite with
python3 -m pytest tests/ -q; it did notcomplete in this checkout, timing out after 600s with failures outside the
targeted gateway extraction tests before reaching 40%.
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/AScreenshots / Logs
N/A — regression tests cover the shared extraction behavior.