Skip to content

Desktop v1.16.0 converts WSL /mnt/c/... workspace to Windows C:\... path and breaks file/session list #30895

Description

@sky10205

Description

OpenCode Desktop v1.16.0 on Windows is connected to an opencode serve instance running inside WSL.

The real workspace path on the WSL server is:

/mnt/c/Projects/ExampleWorkspace

Direct API requests to the WSL server work correctly with this WSL-native path. However, after opening the same workspace in Desktop, the UI fails to list files/sessions with:

Unexpected server error. Check server logs for details.

The WSL server logs show that Desktop sends a translated Windows path back to the Linux/WSL server:

Path is not absolute: C:\Projects\ExampleWorkspace
FileSystem.realPath (/home//C:\Projects\ExampleWorkspace)
FileSystem.realPath (/home//C:/Projects/ExampleWorkspace)

Desktop network logs show requests like:

GET /session/?directory=C%3A%5CProjects%5CExampleWorkspace
GET /session?directory=C%3A%5CProjects%5CExampleWorkspace&roots=true
GET /path?directory=C%3A%2FProjects%2FExampleWorkspace

But the WSL server expects:

/mnt/c/Projects/ExampleWorkspace

I also reset Desktop state/cache and verified the active persisted state no longer contained C:... or C:/... paths. After restarting Desktop, it recreated malformed workspace state and continued sending Windows-style paths to the WSL server.

Confirmed failure point:
Desktop internally translates/restores the server-native WSL path /mnt/c/... into C:... or C:/..., then sends that translated Windows path as the directory query parameter to the WSL server. On Linux/WSL this path is invalid or resolved as /home//C:/..., causing /file, /session, or /path APIs to fail with HTTP 500.

Expected:
When connected to a WSL/remote HTTP server, Desktop should preserve and use the server-native workspace path /mnt/c/... in API requests.

Actual:
Desktop sends C:... or C:/... to the WSL server, causing file/session list failures.

Plugins

None relevant

OpenCode version

Desktop v1.16.0; WSL server/CLI v1.16.0

Steps to reproduce

  1. In WSL, start the server from a workspace under /mnt/c:

    cd /mnt/c/Projects/ExampleWorkspace
    opencode serve --hostname 0.0.0.0 --port 4096

  2. On Windows, open OpenCode Desktop v1.16.0.

  3. Connect Desktop to:

    http://localhost:4096

  4. Open/select the WSL workspace:

    /mnt/c/Projects/ExampleWorkspace

  5. Verify direct API requests work:

    GET http://127.0.0.1:4096/global/health
    GET http://127.0.0.1:4096/session?directory=/mnt/c/Projects/ExampleWorkspace&roots=true&limit=3
    GET http://127.0.0.1:4096/file?directory=%2Fmnt%2Fc%2FProjects%2FExampleWorkspace&path=.

  6. Observe Desktop sidebar errors:

    Failed to list files
    Unexpected server error. Check server logs for details.

    and/or:

    Failed to load sessions
    Unexpected server error. Check server logs for details.

  7. Check WSL server logs. Desktop is sending C:\Projects\ExampleWorkspace or C:/Projects/ExampleWorkspace instead of /mnt/c/Projects/ExampleWorkspace.

Screenshot and/or share link

No response

Operating System

Windows 11 + WSL2

Terminal

Desktop app + WSL server started from WSL shell

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions