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
Web directory picker anchored at OS home instead of server directory (V2 follow-up of #43173) #54626
The V2 web project picker still starts at the OS home directory instead of the server/current directory. E.g. server runs in \C:\Users\boyanzh\Desktop\Programs\repos\xxx\ but the picker opens at \C:\Users\boyanzh\ (home), so nested projects are unreachable and search is home-scoped. Same class of report as #43173 (also confirmed on Linux+docker there).
Root cause
\packages/app/src/workspaces/selection/dialog.tsx:88-95\ computes the start as:
\\ s
props.start ||
sync.data.path.home || // OS home wins
props.location?.directory ||
sync.data.path.directory || // server/current dir loses
fallbackPath.latest?.directory
\\
Actual precedence: explicit start > home > location.directory > server directory > fallback.
Expected
explicit start > server/location directory > home > fallback (the precedence the V1 fix in #50193 established; it was never disputed, only lost in the V2 rewrite).
Thanks for the detailed report. I couldn't reproduce it as described on Linux with v2.0.26:
With opencode serve started inside a nested project directory, the web Add project picker opened at that directory and listed its subfolders, not at home.
The precedence in dialog.tsx doesn't actually decide this. On the web side, the path data always has home set to an empty string (loadPathQuery in packages/app/src/runtime/server/global-sync/bootstrap.ts), so the picker always falls through to the server's location directory.
The picker did open at home when the web UI was connected to the background service, the server that opencode and opencode pair use. That service reports its own starting directory (home here) as its location, wherever you run the CLI. You can see this with opencode api get /api/location.
This was tested on Linux, not Windows. Could you tell us:
Your opencode --version.
How you started the server and opened the web UI: opencode serve run inside ...\repos\xxx, a link from opencode pair (background service), or the desktop app.
What opencode api get /api/location prints when run from that directory.
Reproduced on Windows with pristine dev (707de58, backend serve from a nested dir, password-protected, web dev build):
Start location in the serve flow: correct. The Add project picker opened at the serve directory (.../packages/cli), not home. Matches your Linux result — with home: "" from loadPathQuery the precedence can never land on home there.
Separator bug: confirmed. Typing C:\...\packages + Tab produced C:\...\packages/, and the suggestion list showed C:\...\ai/ etc. — the hardcoded "/" in complete() and the suggestion rows. Fixed in fix(app): use native separators in directory picker #54630 (verified in-browser against that branch: completions now end with \).
On the precedence reorder in fix(app): use native separators in directory picker #54630: it is a no-op for the serve flow (as you said); it only changes flows where home is populated, e.g. child-store/desktop via child-store.ts:237. Kept as hardening plus the separator fix.
Background-service flow (pair link): the picker follows location.directory, which is the service's own start dir. That is location reporting, not dialog precedence — separate from this issue.
Thanks for testing on Windows with 707de58. That lines up with what I found:
Start directory with opencode serve: we agree it works. The picker opens at the server directory, so the problem in this issue's title doesn't happen in that flow.
Background service (opencode pair): agreed, that's about which directory the service reports as its location, not about the picker. It's a separate topic from this issue.
Windows separator: looks plausible from the code. complete() in packages/app/src/workspaces/selection/dialog.tsx adds a hard-coded "/" after the completed directory, and the suggestion rows build paths with / too. I couldn't check it myself because I only have a Linux environment, which never shows backslash paths, so I'm relying on your in-browser check.
The separator bug is a different problem from what this issue reports. It would be easier to track if you either opened a new issue for it (version, steps such as typing C:\...\packages + Tab, expected ...\packages\ versus actual ...\packages/) and pointed #54630 at it, or edited this issue's title and description to cover it and left a comment saying you've updated it. Maintainers will review #54630 either way, including whether they want the start-order change for flows where home is filled in.
Closing this as not planned, since the problem in the title didn't reproduce. With opencode serve, the web picker opens at the server directory: I saw that on Linux with v2.0.26, and you saw the same on Windows with 707de58. The picker starting at home when you use the background service is a separate topic about which directory the service reports.
The Windows separator bug you found (Tab completion adding / instead of \) is still worth tracking. If it still happens, please open a new issue for it with your version and steps and point #54630 at it, so maintainers can review the fix against it. Thanks for digging into this.
Activity
opencode-agent commentedon Oct 11, 2026
Thanks for the detailed report. I couldn't reproduce it as described on Linux with v2.0.26:
opencode servestarted inside a nested project directory, the web Add project picker opened at that directory and listed its subfolders, not at home.dialog.tsxdoesn't actually decide this. On the web side, the path data always hashomeset to an empty string (loadPathQueryinpackages/app/src/runtime/server/global-sync/bootstrap.ts), so the picker always falls through to the server's location directory.The picker did open at home when the web UI was connected to the background service, the server that
opencodeandopencode pairuse. That service reports its own starting directory (home here) as its location, wherever you run the CLI. You can see this withopencode api get /api/location.This was tested on Linux, not Windows. Could you tell us:
opencode --version.opencode serverun inside...\repos\xxx, a link fromopencode pair(background service), or the desktop app.opencode api get /api/locationprints when run from that directory.Related, ordered by relevance:
BoYanZh commentedon Oct 11, 2026
Reproduced on Windows with pristine dev (
707de58, backendservefrom a nested dir, password-protected, web dev build):.../packages/cli), not home. Matches your Linux result — withhome: ""fromloadPathQuerythe precedence can never land on home there.C:\...\packages+ Tab producedC:\...\packages/, and the suggestion list showedC:\...\ai/etc. — the hardcoded"/"incomplete()and the suggestion rows. Fixed in fix(app): use native separators in directory picker #54630 (verified in-browser against that branch: completions now end with\).homeis populated, e.g. child-store/desktop viachild-store.ts:237. Kept as hardening plus the separator fix.pairlink): the picker followslocation.directory, which is the service's own start dir. That is location reporting, not dialog precedence — separate from this issue.opencode-agent commentedon Oct 11, 2026
Thanks for testing on Windows with
707de58. That lines up with what I found:opencode serve: we agree it works. The picker opens at the server directory, so the problem in this issue's title doesn't happen in that flow.opencode pair): agreed, that's about which directory the service reports as its location, not about the picker. It's a separate topic from this issue.complete()inpackages/app/src/workspaces/selection/dialog.tsxadds a hard-coded"/"after the completed directory, and the suggestion rows build paths with/too. I couldn't check it myself because I only have a Linux environment, which never shows backslash paths, so I'm relying on your in-browser check.The separator bug is a different problem from what this issue reports. It would be easier to track if you either opened a new issue for it (version, steps such as typing
C:\...\packages+ Tab, expected...\packages\versus actual...\packages/) and pointed #54630 at it, or edited this issue's title and description to cover it and left a comment saying you've updated it. Maintainers will review #54630 either way, including whether they want the start-order change for flows wherehomeis filled in.opencode-agent commentedon Oct 14, 2026
Closing this as not planned, since the problem in the title didn't reproduce. With
opencode serve, the web picker opens at the server directory: I saw that on Linux with v2.0.26, and you saw the same on Windows with707de58. The picker starting at home when you use the background service is a separate topic about which directory the service reports.The Windows separator bug you found (Tab completion adding
/instead of\) is still worth tracking. If it still happens, please open a new issue for it with your version and steps and point #54630 at it, so maintainers can review the fix against it. Thanks for digging into this.