test: resolve the Windows temp directory to its long name#9573

merged1
windows-tests/temp-cleanup
windows-tests/short-tempdir
openedSep 4, 2026byJJulius Marminge
View on GitHubTwo-way sync enabledPR last imported 4d ago

GitHub's Windows runners set TEMP to the 8.3 short form (C:\Users\RUNNER~1...), and every path that goes through git or realpath comes back in the long form, so equality checks between a temp directory and its canonical form fail. A shared setup file, run by every package's vitest config, points TEMP/TMP at the long form once so os.tmpdir() and everything built on it agree with the canonical spelling.

bootstrap.test opens the platform null device instead of /dev/null and skips the FIFO case, since Windows has neither.

Part of the Windows test-suite stack rooted at #9564; the manual Windows lane comes from #9538.

Model: Claude Fable 5 in Claude Code.

๐Ÿค– Generated with Claude Code

Note

Resolve Windows temp directory to long name in test setup

  • Adds longTempDir.ts, which on win32 resolves the canonical long form of the temp directory and assigns it to TEMP and TMP; non-Windows hosts and resolution failures are left unchanged
  • Wires this setup module into the root, desktop, web, and client-runtime Vite test configs via an absolute path or package subpath export in package.json
  • Updates bootstrap.test.ts to select the platform-specific null device (NUL vs /dev/null) and skips the FIFO timeout test on Windows
  • Behavioral Change: Windows test runs now see long-form TEMP/TMP paths; if resolution fails the environment is untouched

Macroscope summarized 5032af7.


Note

Low Risk Test-only environment and platform-guard changes; production runtime behavior is unchanged aside from optional Vitest setup on Windows.

Overview Adds shared Vitest setup longTempDir.ts that on win32 rewrites TEMP and TMP to the canonical long path from realpathSync, so os.tmpdir() matches git/realpath spelling on GitHub Windows runners (8.3 short names). The module is exported from @t3tools/shared and registered in the root, desktop, web, and client-runtime Vite test configs (server inherits it via mergeConfig with its existing git setup).

bootstrap.test.ts uses NUL vs /dev/null for null-device FD tests and skipIf(windowsHost) on the FIFO timeout case because Windows lacks mkfifo.

Reviewed by Cursor Bugbot for commit 5032af7a8437942c058182d017f5884641e5f8c4. Bugbot is set up for automated code reviews on this repo. Configure here.

Synced from GitHub

Thread transfer impact

โœ… Thread transfer remains within every enforced ceiling.

โ„น๏ธ No successful main baseline artifact is available yet. This run establishes the initial measurement.

ProviderMetricMain baselineThis PRImpactPR ceiling
CodexTotal thread wireโ€”13.6 KiBโ€”15.1 KiBโœ…
CodexThread snapshot wireโ€”7.0 KiBโ€”7.3 KiBโœ…
CodexLive turn WebSocket wireโ€”6.6 KiBโ€”7.8 KiBโœ…
CodexLive turn WebSocket decodedโ€”57.1 KiBโ€”66.4 KiBโœ…
CodexLive turn messagesโ€”10โ€”21โœ…
ClaudeTotal thread wireโ€”13.5 KiBโ€”15.1 KiBโœ…
ClaudeThread snapshot wireโ€”7.0 KiBโ€”7.3 KiBโœ…
ClaudeLive turn WebSocket wireโ€”6.5 KiBโ€”7.8 KiBโœ…
ClaudeLive turn WebSocket decodedโ€”57.8 KiBโ€”66.4 KiBโœ…
ClaudeLive turn messagesโ€”9โ€”21โœ…

Baseline: unavailable ยท PR result: 5032af7 ยท Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 113.8 KiB
  • Claude decoded thread snapshot: 114.5 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

Synced from GitHub

Approvability

Verdict: Not approved

Macroscope's review found this PR not approvable โ€” This is a focused, test-only Windows portability change that canonicalizes temporary directories and avoids unsupported POSIX test primitives, with no product-path behavior changes. The new shared test setup also adds a file-level suppression for an Effect static-analysis diagnostic, warranting explicit human review.

No code changes detected at 5032af7. Prior analysis still applies.

You can add or adjust custom eligibility rules. Learn more.

Synced from GitHub

Same failure on macOS, from the other side: os.tmpdir() is /var/folders/โ€ฆ and anything canonicalised comes back as /private/var/folders/โ€ฆ. On a Mac from today's main:

1FAIL src/entrypoint.test.ts > isEntrypoint > matches through a symlinked entrypoint, as npm and npx install it
2AssertionError: expected false to be true
3
4FAIL src/provider/Layers/CursorProvider.test.ts > Cursor skills > discovers recursive project skills with project precedence
5- "path": "/var/folders/โ€ฆ/T/cursor-skills-workspace-s4PxXA/.cursor/skills/internal/SKILL.md",
6+ "path": "/private/var/folders/โ€ฆ/T/cursor-skills-workspace-s4PxXA/.cursor/skills/internal/SKILL.md",

#9400 and #9401 fix those two in place by resolving the temp dir before asserting (#9389, #9388). Your setup file would cover them as well: with TMPDIR pointed at realpathSync.native(os.tmpdir()) and the tests untouched, both files pass (30/30), same as with the two patches applied.

So if you would rather drop the win32 guard in longTempDir.ts and set TMPDIR on darwin too, I am happy to close #9400/#9401 in favour of this one, or to fold that change into here, whichever you prefer.

Added 1 commit

  • test: resolve the Windows temp directory to its long name5032af7