anomalyco / anomalyco/opencode
Bug: folder picker search anchored to home dir; cannot find projects on other drives (Windows)
@Hona is already working on this.
Since Aug 18, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Title: [Web UI] "Open project" folder picker search is anchored to home directory; cannot find projects on other drives (Windows)
Describe the bug
On Windows, the "Open project" folder picker in the web UI anchors its search base to path.home (the OS user home, e.g. C:\Users\<user>) instead of the directory the server was started from or the current session directory. As a result, even when opencode web is started from the root of another drive (e.g. D:\), a plain-text search (typing a project name) only searches inside C:\Users\<user> and can never find projects located in subdirectories on the other drive.
Steps to reproduce
- On Windows, start
opencode webfrom the root ofD:\. - Open the web UI → click "Open project" (add project).
- Type the name of a project that lives on D: (e.g.
fleximetricatD:\code\python-demo\fleximetric). - The dialog shows "No folder found".
Expected behavior
- A plain-text search should be recursive relative to the server start directory (or the current session directory); or
- The user should at least be able to switch the search base by typing a drive path.
Actual behavior
- Plain-text search is always anchored to
path.home; projects on other drives are never found. - Server log captured from a real browser request:
GET /find/file?directory=C:\Users\<user>&query=fleximetric&dirs=true&limit=50→results=0. - The exact same query with
directory=D:\returnsresults=50, proving the backend recursive search works fine — the bug is purely in the frontend search-base selection.
Root cause analysis
In the web bundle (oc-dialog-v2.js), the dialog search base is computed with this priority:
base = start || path.home || path.directory
The dialog is opened without start, so path.home (OS user home) always wins over path.directory (server start directory). The /path endpoint confirms the two are independent:
{
"home": "C:\\Users\\<user>",
"directory": "D:\\"
}
The frontend search only ever uses home.
Workaround
- In the search box, first type
D:\+ Enter (or click the Root button) to move the browse base to the target drive, then type the project name to search; or - Type the full path
D:/code/python-demoand navigate level by level; or - Open the project once in the TUI — it will then appear in the web sidebar.
Environment
- opencode version: v1.18.18 (npm global install)
- OS: Windows 10/11
- Note: Chinese (non-ASCII) directory names also show as mojibake in the web UI (GBK vs UTF-8 mismatch) — related encoding issue, worth fixing together.
Related issues
- #6490 — identical report (web UI cannot browse projects under
D:\code\python); auto-closed after 60 days of inactivity, never fixed. - #32747 — ripgrepLayer only indexes the directory snapshot from server boot; new files require a restart (related but not identical).
- #28303 — project picker misses deep WSL project folders (same class of "picker search scope" problem).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.