Repository navigation
fix(paths): reject superscript Windows device names - #6148
Merged
WillemJiang merged 1 commit intoOct 3, 2026
Merged
Conversation
siye566
marked this pull request as ready for review
October 1, 2026 05:36
WillemJiang
approved these changes
Oct 2, 2026
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.
Why
The shared host-path validator added in #6102 accepts
COM¹,COM²,COM³,LPT¹,LPT²andLPT³, including lowercase names and names with extensions. Windows reserves these device aliases as documented by Microsoft, so accepting them defeats the existing cross-platform creation policy.What changed
Uploads, new skill support files and new local sandbox paths now reject these six aliases through the existing shared validator. The existing read/removal exemptions remain intact. Similar ordinary names such as
COM⁴.txt,COM¹notes.txtandLPT²0.mdremain accepted. README and utility guidance describe the policy.Surface area
skills/The shared validator also serves upload filenames and skill support-file paths.
Bug fix verification
Regression cases exercise
normalize_filename,ensure_safe_support_pathandvalidate_local_tool_path, including an intermediate reserved directory, mixed case, extensions, legal lookalikes and read exemptions.With only the regression tests added to
main(5b83cb5), the focused selection produced 15 failed, 27 passed. With the fix, the three complete affected test files produced 264 passed, 8 skipped.Validation
From
backend/, using the locked development environment on Windows withPYTHONPATH=.,PYTHONUTF8=1andPYTHONIOENCODING=utf-8:uv run --no-sync pytest tests/test_uploads_manager.py tests/test_skill_storage_support_files.py tests/test_sandbox_tools_security.py -q— 264 passed, 8 skipped.uv run --no-sync pytest tests/blocking_io/test_uploads_router.py tests/blocking_io/test_sandbox_authorization.py tests/blocking_io/test_skills_custom_router.py -q— 11 passed.uv run --no-sync ruff check .anduv run --no-sync ruff format --check .— passed.origin/main— 0 errors, 0 warnings.Both broader offline targets were run before and after the production change, capped at three failures. They did not pass in this Windows environment:
pytest -m "not live" --ignore=tests/blocking_io tests/ -q --maxfail=3— both runs stopped at the same threetest_browser_assets.pyfailures (WinError 1314, symlink privilege unavailable); 2222 passed, 95 skipped, 6 deselected.pytest tests/blocking_io -q --maxfail=3— both runs stopped at the same threetest_channel_runtime_config_store.pyPOSIX-mode assertions; 45 passed.AI assistance
Tool(s) used: Codex.
How you used it: Codex investigated the gap, checked existing contributions and Microsoft documentation, wrote the fix and regression tests, and ran the validation above. The author reviewed the complete diff and confirmed understanding and responsibility before marking this PR ready for review.