Closed
Conversation
added 5 commits
April 10, 2026 15:44
…omalyco#21441) On Windows, directory paths used backslashes which caused cache key mismatches in Maps (booting, sdkCache, sessionMeta, queue, prefetch, seen). Extract Filesystem.posixPath() on the server and consistently use workspaceKey() on the client so all lookups use normalized paths.
… compatibility (anomalyco#21441) - Update project.test.ts to use Filesystem.posixPath for sandbox comparisons - Update global-session-list.test.ts to use Filesystem.posixPath for worktree comparisons - Add unit tests for posixPath, contains, and overlaps
…-normalization # Conflicts: # packages/app/src/context/sync.tsx # packages/opencode/src/server/instance.ts
- Resolve 8.3 short paths in Global.Path via Filesystem.resolve() to ensure consistent canonical paths for data/cache/config/state directories - Normalize path.cwd and path.root with posixPath() in session prompt messages for cross-platform consistency - Fix session project_id update query to use posixPath() on worktree comparison
Contributor
|
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
Contributor
|
The following comment was made by an LLM, it may be inaccurate: Potential Duplicate FoundPR #21852:
|
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.
Closes #21441
Summary
Filesystem.posixPath()and apply to all API responses and session read/write paths for consistent POSIX-style outputcontains()andoverlaps()to returnfalsefor cross-drive paths on WindowsworkspaceKey()for all internal map keys to prevent duplicate caches from mixed path formats (D:/foovsD:\foo)normalizeDirectoryin Session withFilesystem.posixPathposixPath,contains,overlaps; update existing tests for path format consistencyIssue for this PR
Closes #21441
Type of change
What does this PR do?
On Windows, the same directory can have different path formats (
D:/foovsD:\foo), causing:path.relative()returns the target as-is for cross-drive paths, socontains()incorrectly returnedtruefor arbitrary paths like/etc/passwd.booting,sdkCache,sessionMeta, etc.) used raw directory as keys, creating duplicate entries and causing session data loss on store eviction.Fix: Add
isAbsoluteguard tocontains()/overlaps()for cross-drive detection. ExtractposixPath()as single normalization function. Apply it consistently at server API boundaries and client cache keys.How did you verify your code works?
bun typecheckpasses (13/13 packages)posixPath()edge cases: drive roots, trailing slashes, mixed separatorsloadSessionscall paths → API requests → store writes → render, confirming the normalization unifies all paths.Checklist