Prevent skills manifests from hashing files outside the skill directory#3410
Merged
Prevent skills manifests from hashing files outside the skill directory#3410
Conversation
🤖 Generated with GPT-5.2-Codex
Member
Author
|
Auto-reviewed and merging on behalf of @jlowin — CI is green (Windows OAuth proxy timeouts are pre-existing flaky tests). |
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.
Motivation
Description
scan_skill_filesto resolve the skill root and each discovered file, and skip any discovered entry whose resolved target is not inside the resolved skill directory before computingstat()or hashing; sizes/hashes are now computed from the resolved in-skill path only. (Seesrc/fastmcp/server/providers/skills/_common.py.)tests/server/providers/test_skills_provider.py.)Testing
uv syncand dependency resolution succeeded.uv run ruff checkanduv run ruff formatfor the modified files and fixed formatting;ruff checkpassed on the changed files.uv run pytest tests/server/providers/test_skills_provider.py -n autoand the skill-provider tests (including the new regression test) passed (43 passed).uv run pytest -n auto; unrelated existing tests in the environment showed several timeouts/failures (external to this change) while the modified skill-provider tests passed locally.uv run prek run --all-filesfailed to initialize hooks due to network restrictions fetching a pre-commit hook, not due to code issues.Codex Task