fix(gateway): add canonical cache paths to MEDIA_DELIVERY_SAFE_ROOTS - #33586
Closed
liuhao1024 wants to merge 1 commit into
Closed
fix(gateway): add canonical cache paths to MEDIA_DELIVERY_SAFE_ROOTS#33586liuhao1024 wants to merge 1 commit into
liuhao1024 wants to merge 1 commit into
Conversation
When get_hermes_dir() resolves to a legacy path (e.g. ~/.hermes/image_cache), the canonical path (e.g. ~/.hermes/cache/images) was not in MEDIA_DELIVERY_SAFE_ROOTS. MEDIA directives referencing canonical paths were silently filtered out. Fixes NousResearch#33549
Collaborator
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?
MEDIA_DELIVERY_SAFE_ROOTSmissed the canonical~/.hermes/cache/paths whenget_hermes_dir()resolved to a legacy location. This caused valid Hermes-managed media artifacts to be silently filtered out before gateway delivery.Related Issue
Fixes #33549
Type of Change
Changes Made
How to Test
pytest tests/ -q— all tests should passChecklist
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 and workflows — or N/ACode Intelligence
MEDIA_DELIVERY_SAFE_ROOTS(gateway/platforms/base.py, line 830) — used by_media_delivery_allowed_roots()→validate_media_delivery_path()→filter_media_delivery_paths()get_hermes_dir()backward compatibility (hermes_constants.py:197) — new installs use canonical paths, existing installs keep legacy pathsTests
TestMediaDeliverySafeRootsDefaultsintest_platform_base.pyverifying both canonical and legacy paths are presentTestMediaDeliveryPathValidationtests passChecklist
git diff --stat upstream/mainshows only relevant files (2 files)