Skip to content

fix(paths): reject superscript Windows device names - #6148

Merged
WillemJiang merged 1 commit into
bytedance:mainfrom
siye566:fix/windows-superscript-device-names
Oct 3, 2026
Merged

WillemJiang merged 1 commit into
bytedance:mainfrom
siye566:fix/windows-superscript-device-names

Conversation

@siye566

@siye566 siye566 commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Why

The shared host-path validator added in #6102 accepts COM¹, COM², COM³, LPT¹, LPT² and LPT³, 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.txt and LPT²0.md remain accepted. README and utility guidance describe the policy.

Surface area

  • Frontend UI
  • Backend API — no endpoint or response-shape changes
  • Agents / LangGraph
  • Sandbox — existing host-path creation validation
  • Skills — no changes under skills/
  • Dependencies
  • Default behavior change — previously accepted nonportable creation names are rejected
  • Docs / tests / CI only

The shared validator also serves upload filenames and skill support-file paths.

Bug fix verification

Regression cases exercise normalize_filename, ensure_safe_support_path and validate_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 with PYTHONPATH=., PYTHONUTF8=1 and PYTHONIOENCODING=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 . and uv run --no-sync ruff format --check . — passed.
  • Agent guidance check against 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 three test_browser_assets.py failures (WinError 1314, symlink privilege unavailable); 2222 passed, 95 skipped, 6 deselected.
  • pytest tests/blocking_io -q --maxfail=3 — both runs stopped at the same three test_channel_runtime_config_store.py POSIX-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.

  • I've read and understand every line of this change and take responsibility for it — it's not unreviewed AI output.

@CLAassistant

CLAassistant commented Oct 1, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@siye566
siye566 marked this pull request as ready for review October 1, 2026 05:36
@github-actions github-actions Bot added area:backend Gateway / runtime / core backend under backend/ area:docs Documentation and Markdown only risk:medium Medium risk: regular code changes size/S PR changes 20-100 lines labels Oct 1, 2026
@WillemJiang
WillemJiang merged commit 3a7e160 into bytedance:main Oct 3, 2026
25 checks passed
@WillemJiang WillemJiang added this to the 2.2.0 milestone Oct 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:backend Gateway / runtime / core backend under backend/ area:docs Documentation and Markdown only risk:medium Medium risk: regular code changes size/S PR changes 20-100 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants