Skip to content

Conversation

@Hona
Copy link
Collaborator

@Hona Hona commented Feb 3, 2026

~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

  • Fixes lsp_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"
  • Fixes OpenCode 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
@github-actions
Copy link
Contributor

github-actions bot commented Feb 3, 2026

Hey! Your PR title ignore doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 3, 2026

The following comment was made by an LLM, it may be inaccurate:

I can see the PR file, but the title and description are both just "ignore", which doesn't provide meaningful keywords to search for duplicates.

Could you provide the actual PR title and description? This will help me search for potentially related or duplicate PRs effectively.

@Hona Hona changed the title ignore fix(win32): path handling Feb 4, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

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 free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant