Skip to content

fix(workspace): keep the write probe inside the Windows path limit - #2398

Merged
pancacake merged 1 commit into
HKUDS:devfrom
Antonio-Faure:fix/workspace-long-path-probe
Nov 5, 2026
Merged

pancacake merged 1 commit into
HKUDS:devfrom
Antonio-Faure:fix/workspace-long-path-probe

Conversation

@Antonio-Faure

Copy link
Copy Markdown
Contributor

Why

ContentWorkspaceService._ensure_ready proves the outputs folder is writable with a temporary file named:

.deeptutor-write-probe-<32 hex characters>

That is 55 characters. On Windows, a custom workspace root under a deep account path can already sit near the 260-character MAX_PATH; adding the probe pushes it over. Path.touch then raises FileNotFoundError (WinError 206), which the service reported as:

The workspace outputs folder is not writable.

The folder is writable — the path is just too long. This is product bug 2 in #2354, reproduced there with DEEPTUTOR_WORKSPACE_ROOT and deep workspace ids.

What changes

  • Shorten the probe to .dt-wp-<12 hex> (19 characters), which removes 36 characters from the probed path. The reported case was ~272 characters, so it now fits; other deep roots at least fail with the right explanation.

  • When the probe fails with WinError 206 or errno.ENAMETOOLONG, raise a distinct message:

    The workspace path is too long for this system. Choose a shorter folder.

  • A real permission failure still reports “not writable”, and the symlink/escape checks are unchanged.

The service already used a short probe name in the setup path; this brings the workspace probe in line with it.

Tests

pytest -q tests/services/workspace/test_content_workspace.py
28 passed

New coverage:

  • the probe name is at most 20 characters;
  • a WinError 206 failure is reported as a path-length problem, not a permission problem;
  • a PermissionError still produces “not writable”.

Windows itself is simulated with the winerror attribute; the failure mode is the same OSError branch the service already handled.

Refs #2354.

@pancacake
pancacake merged commit 25eea13 into HKUDS:dev Nov 5, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants