You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Windows Desktop passes WSL UNC paths to a Linux server, causing HTTP 500 errors and persistent startup crashes #52205
I am using OpenCode Desktop on Windows 11, connected to an OpenCode v2 server running inside WSL2.
When I add a WSL project through the desktop app, it opens the native Windows folder picker. Selecting a folder inside WSL returns a Windows UNC path, such as:
\\wsl.localhost\UbuntuD\home\tmbv\src\Admin.Net
The desktop app passes this path directly to the Linux server instead of converting it to:
/home/tmbv/src/Admin.Net
The Linux server then fails to resolve the directory. The project may appear in the desktop UI, but its conversation history and Git information cannot be loaded. Requests return HTTP 500, and the desktop app can enter a fatal error screen.
In the Windows desktop app, click the Add project icon.
-> a Linux folder picker opens, allowing to navigate a Linux file system, e.g.: /home/<username>/dev/<git_repo_name>
I think this is expected behavior. Windows consumers of this app probably never running the server in WSL. So this is a development environment issue. A policy such as, run all the things in windows all the time for dev makes sense because that mimics a windows user experience.
To go down the route of doing X in windows but Y in Linux opens up a large bug surface area that will take up dev time.
I've dug deeper and it looks like this is a documented setup (packages/web/src/content/docs/windows-wsl.mdx). I think the use case for running a server via the CLI is to connect the desktop app remotely. If you do this locally, the app uses the native file picker, which returns windows paths in this case..
I think the right solution is to use the in-app picker for every server except the one the app started itself. This will fix the 500 error this issue is targeting.
I've got a working solution running locally and have tested it.
Thanks for the report, and thanks @kenden for the steps. I couldn't run the Windows desktop app here, but I confirmed the parts I could:
With opencode serve v2.0.20 on Linux, asking for project/git info with the path \\wsl.localhost\UbuntuD\home\tmbv\src\Admin.Net returns HTTP 500 with an empty body. A normal Linux path works fine.
On the latest dev (86ce19d), the same request returns a 404 "Location not found" error instead of a 500.
The cause in the desktop app is still on dev: any server at localhost/127.0.0.1 is treated as the app's own local server, so it uses the native Windows folder picker. With a WSL server, that picker returns UNC paths. I haven't checked whether the 404 on dev avoids the fatal error screen.
The script below reproduces the server-side part. Until this is addressed, @kenden's workaround avoids it: run the server with --hostname 0.0.0.0 and connect to the WSL IP instead of localhost. You then get the in-app Linux folder picker.
Related: #19473 (same root cause, closed), #33550 and #34255 (closed), and the open PR #53628, which changes the desktop check.
Reproduction script (repro.sh)
#!/usr/bin/env bash# Server-side half of #52205: a Linux `opencode serve` given the Windows UNC path# that the Desktop native folder picker returns for a WSL folder answers HTTP 500.# Usage: ./repro.sh -> uses `opencode` from PATH# OC_DEV=/path/to/repo ./repro.sh -> runs the CLI from a source checkoutset -u
PROJ=$(mktemp -d);cd"$PROJ"; git init -q
PORT=4097; LOG=$(mktemp)if [ -n"${OC_DEV:-}" ];then
bun --conditions=browser --preload="$OC_DEV/packages/tui/node_modules/@opentui/solid/scripts/preload.js" \
"$OC_DEV/packages/cli/src/index.ts" serve --hostname 127.0.0.1 --port $PORT>"$LOG"2>&1&else
opencode serve --hostname 127.0.0.1 --port $PORT>"$LOG"2>&1&fi
SRV=$!foriin$(seq 60);do grep -q "server password""$LOG"&&break; sleep 1;done
PASS=$(sed -n 's/^server password //p'"$LOG")fordin"$PROJ"'\\wsl.localhost\UbuntuD\home\tmbv\src\Admin.Net';doecho"== location[directory]=$d"
curl -s -u "opencode:$PASS" -w '\nHTTP %{http_code}\n' -G \
--data-urlencode "location[directory]=$d""http://127.0.0.1:$PORT/api/vcs"donekill$SRV
Activity
github-actions commentedon Sep 30, 2026
This issue might be a duplicate of existing issues. Please check:
kenden commentedon Oct 1, 2026
I can reproduce, with OpenCode Windows Desktop v2.0.20 on Windows 11 and opencode cli v2.0.20 inside of WSL 3.0.1.0.
How to reproduce
opencode serve --hostname 127.0.0.1 --port 4096-> note the server password
-> a native Windows folder picker opens.
Expected: it should be a Linux folder picker.
Workaround
Connect with the IP address of the WSL machine instead.
Note that then, starting the server on
127.0.0.1is not going to work.opencode serve --hostname 0.0.0.0 --port 4096-> note the server password
hostname -I | cut -f1 -d ' '-> example:
172.25.192.185-> a Linux folder picker opens, allowing to navigate a Linux file system, e.g.:
/home/<username>/dev/<git_repo_name>Embiggenerd commentedon Oct 4, 2026
I think this is expected behavior. Windows consumers of this app probably never running the server in WSL. So this is a development environment issue. A policy such as, run all the things in windows all the time for dev makes sense because that mimics a windows user experience.
To go down the route of doing X in windows but Y in Linux opens up a large bug surface area that will take up dev time.
Embiggenerd commentedon Oct 5, 2026
I've dug deeper and it looks like this is a documented setup (packages/web/src/content/docs/windows-wsl.mdx). I think the use case for running a server via the CLI is to connect the desktop app remotely. If you do this locally, the app uses the native file picker, which returns windows paths in this case..
I think the right solution is to use the in-app picker for every server except the one the app started itself. This will fix the 500 error this issue is targeting.
I've got a working solution running locally and have tested it.
PR #53628 is submitted.
opencodejr commentedon Oct 28, 2026
Thanks for the report, and thanks @kenden for the steps. I couldn't run the Windows desktop app here, but I confirmed the parts I could:
opencode servev2.0.20 on Linux, asking for project/git info with the path\\wsl.localhost\UbuntuD\home\tmbv\src\Admin.Netreturns HTTP 500 with an empty body. A normal Linux path works fine.dev(86ce19d), the same request returns a 404 "Location not found" error instead of a 500.dev: any server atlocalhost/127.0.0.1is treated as the app's own local server, so it uses the native Windows folder picker. With a WSL server, that picker returns UNC paths. I haven't checked whether the 404 ondevavoids the fatal error screen.The script below reproduces the server-side part. Until this is addressed, @kenden's workaround avoids it: run the server with
--hostname 0.0.0.0and connect to the WSL IP instead oflocalhost. You then get the in-app Linux folder picker.Related: #19473 (same root cause, closed), #33550 and #34255 (closed), and the open PR #53628, which changes the desktop check.
Reproduction script (repro.sh)
Run it:
bash repro.sh