fix(gateway): allow canonical media cache delivery roots - #33550
Closed
chbo297 wants to merge 1 commit into
Closed
Conversation
Collaborator
This was referenced May 28, 2026
Contributor
|
Thanks for this — the fix is correct, but it's already on The issue was then reopened for a narrower case your PR doesn't cover: profile-scoped gateways with a symlinked Closing as already-implemented. Appreciate the contribution. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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?
Adds the canonical Hermes media cache directories to the default native media delivery safe roots.
Hermes cache helpers prefer paths under
~/.hermes/cache/, but installations that still have legacy cache directories can resolveIMAGE_CACHE_DIR,AUDIO_CACHE_DIR, etc. to legacy paths. In that state, media files written to the canonical cache directories may be filtered out before gateway delivery.This keeps the existing legacy roots and safety checks intact, while always allowlisting:
~/.hermes/cache/images~/.hermes/cache/audio~/.hermes/cache/videos~/.hermes/cache/documents~/.hermes/cache/screenshotsRelated Issue
Fixes #33549
Type of Change
Changes Made
gateway/platforms/base.py: add canonical~/.hermes/cache/*media directories toMEDIA_DELIVERY_SAFE_ROOTS.tests/gateway/test_platform_base.py: add regression coverage for the canonical roots.How to Test
Focused tests run on macOS with Python 3.11.15:
Result:
Full
pytest tests/ -qwas not run in this local pass.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
Not applicable; this is path allowlist behavior covered by automated tests.