Skip to content

fix(win32): path handling - #11897

Closed
Hona wants to merge 60 commits into
anomalyco:devfrom
Hona:feat/v2-bash-path-windows
Closed

fix(win32): path handling#11897
Hona wants to merge 60 commits into
anomalyco:devfrom
Hona:feat/v2-bash-path-windows

Conversation

@Hona

@HonaHona commented Feb 3, 2026

Copy link
Copy Markdown
Member

~75% of this PR is test code

  • Add @/util/path module that normalizes all paths to POSIX format (/) on Windows
  • Replace native path imports across 126 files
  • Enable full CI test suite on Windows (was previously skipped)
  • Handle Git Bash/MSYS paths (/c/Users/... → C:/Users/...)
  • Add --path-separator=/ to ripgrep for consistent output

From the new architecture tests to help force pit of success down the line:

// Canonical rule: paths are POSIX/Bash-compatible everywhere.
// Why: Windows backslashes caused
// - UI file search/filter mismatches (client query used "\" while indexed paths used "/")
// - server/client path comparisons to fail (drive/UNC edge cases)
// - bash tool arg parsing to mis-handle paths ("\" is an escape in bash)
// Enforcement via import boundaries:
// - opencode/src must use @/util/path (Node wrapper + /tmp mapping)
// - app/ui/web/sdk/desktop/plugin must use @opencode-ai/util/path (browser-safe)
// - native path/node:path imports are disallowed everywhere

For me to manually test each one by one:

Fixes

Core Path Normalization

LSP & Ripgrep

  • Fixeslsp_tools_show_incorrect_status_on_Windows #11400
    • test/lsp/document-symbol-paths.test.ts → "windows: converts file:// URI to drive-letter path"
    • test/lsp/index.test.ts → "skips servers with invalid roots"
    • test/tool/diagnostics-paths.test.ts → "accepts posix diagnostics keys", "windows: accepts canonical diagnostics keys"
  • FixesOpenCode Desktop Windows ripgrep always fail #5727
    • test/tool/grep-paths.test.ts → "windows: accepts MSYS-style absolute search paths"
    • test/file/ripgrep.test.ts (updated with toPosix)

Glob/File Operations

Permission/Security


New Test Files Added (16)

  • test/lsp/document-symbol-paths.test.ts
  • test/lsp/index.test.ts
  • test/project/instance-paths.test.ts
  • test/server/pty.test.ts
  • test/session/prompt.test.ts
  • test/tool/bash-paths.test.ts
  • test/tool/diagnostics-paths.test.ts
  • test/tool/edit-paths.test.ts
  • test/tool/glob-paths.test.ts
  • test/tool/grep-paths.test.ts
  • test/tool/lsp-paths.test.ts
  • test/tool/multiedit-paths.test.ts
  • test/tool/write-paths.test.ts
  • test/util/no-native-path-imports.test.ts
  • test/util/path.test.ts
  • test/worktree/worktree-paths.test.ts

Hona added 30 commits January 29, 2026 10:34
@HonaHona changed the title ignorefix(win32): path handlingFeb 4, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant

@Hona