Repository navigation
Conversation
download_skill built resource URIs from raw manifest paths. Because the server unquotes path parameters once, a path such as '100%20score.md' was requested as '100 score.md' and the wrong file's bytes were written; a path containing '#' was truncated at the URI fragment, failing or reading a sibling. Quote skill names and file paths with safe='/' so the URI matches the one SkillProvider lists. Add regression tests for percent-triplet and '#' file names, nested paths, and the exact requested URIs.
The server emits the skill-name segment raw and matches it before any unquoting, so percent-encoding it broke downloads for names containing legal sub-delimiters or a literal percent (pdf!, a&b, plus+name, 100%20score). Quote only the file path, which is what the server actually encodes and unquotes. Add a parameterized regression test for skill names containing those characters.
|
This pull request is awaiting maintainer assignment. Linked PRs stay open while maintainers triage the issue; this check remains failing until assignment. Per CONTRIBUTING.md, an external PR must reference an issue that's assigned to its author. To get there:
Once you're assigned and the link is present, this check is re-run automatically. Previously gate-closed PRs also reopen — no further action needed. Maintainers: reopen this PR or remove the |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
thanks! this overlaps with #5820, which covers the same skill-path encoding and conflicts with this branch, so i'm closing this one to keep it to a single PR. Generated by Claude Code |
Closes #5826
Description
download_skill()builtskill://{skill_name}/{file_info.path}from the server's raw manifest paths without percent-encoding. Because the server unquotes path parameters once, a file named100%20score.mdwas fetched as100 score.md(wrong bytes) and a file namednotes#1.mdwas truncated at the URI fragment (failure or a sibling's content). The server already publishes percent-encoded URIs inSkillProvider._list_resources; the client now requests the same form.The download URI is built with
quote(file_info.path, safe='/'), preserving nested paths. The skill-name segment is deliberately left raw: the server emits and matches it without quoting (SkillProvider._list_resources,_get_resource,_get_resource_template), so encoding it would regress names containing legal sub-delimiters or a literal percent (e.g.pdf!,a&b,100%20score). A parameterized regression test pins those names.Contribution type
Bug fix verification
Test path:
tests/utilities/test_skills.py::TestDownloadSkillUriEncoding(4 tests).Before the fix (current
mainadf90b6):After the fix: all eight pass, and independent repro scripts download the correct bytes for percent-triplet, hash-shadow, hash-only, nested-space, unicode, and ordinary nested paths. The parameterized skill-name tests pass on current
mainas well — they guard against re-introducing name encoding (an intermediate revision quoted the name and failed them).Validation
uv run --frozen pytest tests/utilities/test_skills.py -q-> 34 passeduv run --frozen pytest tests/server/providers/test_skills_provider.py tests/server/providers/test_skills_vendor_providers.py tests/server/providers/test_skill_main_files.py -q-> 120 passeduv run --frozen ruff checkandruff format --checkon the changed files -> cleanAI assistance
Tool(s) used: Claude Code
How you used it: investigated from a verified reproduction, drafted the fix and regression tests.
Checklist
uv run prek run --all-filesand all checks pass