Repository navigation
Description
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
-
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 -
On Windows, open OpenCode Desktop v1.16.0.
-
Connect Desktop to:
-
Open/select the WSL workspace:
/mnt/c/Projects/ExampleWorkspace
-
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=. -
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. -
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
Activity
github-actions commentedon Jun 5, 2026
This issue might be a duplicate of existing issues. Please check:
/home/<wsl-user>/C:/...)\\wsl.localhostor Windows-style paths to a WSL server instead of the server-native pathIf your issue has distinct details or a different reproduction path not covered by these, please link to them and explain the difference.
SrHenry commentedon Jun 5, 2026
Having this exact same issue, never happened before v1.16.0
sky10205 commentedon Jun 5, 2026
Thanks. I agree this is related to earlier WSL path issues, but this report is specifically for a v1.16.0 regression.
Another user also confirmed the exact same issue and said it never happened before v1.16.0.
The key difference from the older reports is that direct WSL server API calls with /mnt/c/... work, but Desktop v1.16.0 still sends C:... or C:/... as the directory query parameter to the WSL server for file/session/path APIs, even after clearing persisted Desktop state/cache. Desktop then recreates malformed workspace state after restart.
So this seems to be an internal Desktop path restoration/translation issue in v1.16.0, not only stale local state or a corrupted server DB.
c17r commentedon Jun 8, 2026
Also happens when using
opencode webinside WSL but the browser is on the Windows side.WhiteGiverMa commentedon Jun 23, 2026
Can confirm this is still reproducible on v1.17.9, with an additional trigger scenario: directory rename.
Environment
G:\dev\dreamer-heroines(Windows) //mnt/g/dev/dreamer-heroines(WSL)http://localhost:4096(WSL2 port-forwarded)Scenario
The project directory was renamed from
DreamerHeroinestodreamer-heroines. After the rename:%LOCALAPPDATA%\opencode\opencode.db) stores the path asG:/dev/dreamer-heroines— correct for Desktop's own file operations~/.local/share/opencode/opencode.db) stores the path as/mnt/g/dev/dreamer-heroines— correct for WSL serveBoth databases are independently correct for their respective platforms. The problem occurs when Desktop reads the Windows-native path from its own DB and sends it as-is to the WSL server via API:
WSL server log:
On Linux,
path.resolve("G:/dev/dreamer-heroines")treats this as a relative path, prepending CWD:→
/home/{user}/G:/dev/dreamer-heroines→ doesn't exist → HTTP 500Workaround attempted
Changed Windows-side DB paths to
/mnt/g/format — this fixes the WSL server interaction but breaks Desktop's own file operations (it can't resolve/mnt/g/paths natively on Windows). This confirms the fix must be in Desktop's API client layer (path translation before sending to remote server), not in the database.Additional note: file picker corruption
When Desktop receives the malformed path back from the server, it also corrupts the file picker state:
This suggests the Windows path is being concatenated with the WSL CWD somewhere in the file picker initialization logic as well.
romanilyin commentedon Jun 27, 2026
I traced the server-side failure to the
directoryrequest boundary and opened #33107 to discuss a staged path contract.The first PR (#34256) only prevents a client-native Windows path from reaching instance loading and returns a clear 400. It would not close this issue: Desktop still needs to preserve/send
/mnt/c/...when connected to a WSL server.Realmagnum commentedon Aug 26, 2026
Same root cause on Windows Desktop 1.18.23 → Linux
opencode serve(server at<internal-host>, project at<internal-path>/work-projects).The remote connection itself works: server returns 401 without creds (basic auth), and the client receives server events (turn-complete notifications land in
opencode.global.datfor the configured server URL). But the Home UI never lists the remote project/sessions.Decisive log line from the bundled sidecar (
~/.local/share/opencode/log/opencode.log):So the Windows client translates the server-native POSIX path
/home/srv/projects/work-projectsintoC:\home\srv\projects\work-projectsand tries torealPathit locally → ENOENT → project/session list never loads.Notes:
opencode.workspace.-home-srv-pr.*.datworkspace state for the remote project path, confirming it treats the remote worktree as a local workspace.thdxr commentedon Oct 11, 2026
Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (
opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊