Repository navigation
Description
Description
When using OpenCode Desktop (Windows) connected to an opencode serve instance running inside WSL2, renaming a project directory causes Desktop to send Windows-native paths (e.g. G:/dev/dreamer-heroines) to the WSL server, which expects Linux-native paths (e.g. /mnt/g/dev/dreamer-heroines). This results in Path is not absolute errors and Unexpected server error in the UI.
This is a variant of #30895, triggered specifically by the directory rename scenario where the Windows-side DB retains the renamed Windows path but no path translation occurs when communicating with the WSL server.
Environment
| Component | Version / Detail |
|---|---|
| Desktop | OpenCode Desktop (Electron), Windows 11 |
| WSL server | opencode serve v1.17.9, WSL2 Ubuntu 24.04 |
| Kernel | 6.6.87.2-microsoft-standard-WSL2 |
| Connection | Desktop → http://localhost:4096 (WSL2 port-forwarded) |
| Project | G:\dev\dreamer-heroines (Windows) / /mnt/g/dev/dreamer-heroines (WSL) |
Root cause
Desktop reads the Windows-native path G:/dev/dreamer-heroines from its local SQLite DB and sends it without translation to the WSL server via the session list API:
GET /session?directory=G:/dev/dreamer-heroines
On the WSL (Linux) side, path.resolve("G:/dev/dreamer-heroines") treats the Windows path as relative, prepending the server's CWD:
→ /home/{user}/G:/dev/dreamer-heroines → path doesn't exist → HTTP 500
This is the same path translation bug as #30895, but the rename scenario adds complexity:
- Both databases (Windows-side and WSL-side) are independently correct for their platform
- The bug only manifests in the cross-server API communication layer
- Changing Windows-side DB paths to
/mnt/g/format fixes the WSL interaction but breaks Desktop's native file operations
Expected behavior
When Desktop communicates with a remote/WSL server, it should translate Windows-native paths (G:/dev/...) to the server's native format (/mnt/g/dev/...) before sending API requests.
Actual behavior
Desktop sends Windows-native paths directly to the WSL server, causing Path is not absolute errors and breaking the session list and file picker.
Workaround
Delete the project record from the Windows-side DB so Desktop re-discovers it:
DELETE FROM session WHERE project_id = '<project_hash>';
DELETE FROM project_directory WHERE project_id = '<project_hash>';
DELETE FROM project WHERE id = '<project_hash>';Then clear Electron cache and restart Desktop. The project will need to be re-added manually.
Related issues
- Desktop v1.16.0 converts WSL /mnt/c/... workspace to Windows C:\... path and breaks file/session list #30895 — Desktop converts WSL
/mnt/c/...to WindowsC:\...path (same root cause, original report) - Desktop GUI sidebar empty when connected to WSL2 opencode serve #29766 — Desktop GUI sidebar empty with WSL serve (Root Cause 2: path concatenation)
- Desktop App sends UNC paths to WSL-hosted server, breaking all bash tool calls [WORKAROUND ✅ ] #19473 — Desktop sends UNC paths to WSL-hosted server
- 2 bugs spotted when running Windows Desktop connects to opencode server in WSL: Shell runtime & Path Detection #8378 — Path detection broken between Windows Desktop and WSL server
- Path Confusion in OpenCode Desktop with WSL Server: Files Not Visible #21193 — Path confusion in Desktop with WSL server
Plugins
Oh My OpenAgent (the bug is a original behavior.)
OpenCode version
1.17.9
Steps to reproduce
-
In WSL2, start the server:
cd /mnt/g/dev/dreamer-heroines opencode serve --hostname 0.0.0.0 --port 4096 -
On Windows, rename the project folder from
DreamerHeroinestodreamer-heroines(case change). -
Open OpenCode Desktop and connect to
http://localhost:4096. -
Open the project
G:\dev\dreamer-heroinesfrom the project list. -
Observe the sidebar error:
Unexpected server error. Check server logs for details. -
Check WSL server logs (journalctl):
ERROR: Path is not absolute: G:/dev/dreamer-heroines at U0 (chunk-arezpm57.js:59:16502) at buildQueryFromSourceParams (chunk-arezpm57.js:2:5450) at Session.list (chunk-e6zcxa2p.js:3:8541) -
Also observe file picker corruption:
ERROR: Failed to init file picker: Invalid path /home/{user}/G:/dev/dreamer-heroines
Screenshot and/or share link
No response
Operating System
Windows 11 & WSL2 Ubuntu 24.04
Terminal
Windows Terminal
Activity
github-actions commentedon Aug 23, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.