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 project picker is empty until a search is entered #37611
In opencode web, opening Add Project initially shows "No folders found" even though the startup/home directory contains folders.
The empty filter is sent to /find/file as query=, which returns an empty list. Entering a path makes folders appear, so project selection is not discoverable on first open.
Plugins
Reproduces without plugins.
OpenCode version
1.18.2
Steps to reproduce
Run opencode web --hostname 0.0.0.0 --port 8088.
Open the Web UI.
Click Add Project.
Observe that the picker says no folders were found.
Expected: list folders in the startup/home directory.
Actual: empty picker until text is entered.
Screenshot and/or share link
Network request: GET /find/file?directory=<home>&query=&type=directory&limit=50 returns [].
This issue might be a duplicate of existing issues. Please check:
[BUG] opencode web can not open projects #37005: Same symptom — opencode web Add Project picker returns no results when query is empty (find file query="" results=0), making project selection fail on first open.
Independent reproduction on 1.18.9 (arm64, Jetson / Ubuntu 20.04). Confirming this, and I think I can add the missing piece of why the empty query returns nothing.
The empty filter takes a different code path from a typed one
packages/app/src/components/directory-picker-domain.ts, in createDirectorySearch:
constpathInput=raw.startsWith("~")||!!pickerRoot(raw)||raw.includes("/")if(!pathInput){constresults=awaitargs.sdk.api.file.find({location: {directory: input.directory}, query,type: "directory",limit: 50})...}// inputs containing "/" fall through to match() -> directories() -> file.list()
An empty filter is not pathInput, so it goes to file.find. Anything containing / goes to file.list. That asymmetry is the whole bug: file.list works fine, file.find does not, in exactly the directory the picker opens on.
Why file.find returns empty there
file.find is backed by the FFF index, which refuses to run in a home directory or the filesystem root — the two places the picker defaults to (dialog-select-directory-v2.tsx uses sync.data.path.home || sync.data.path.directory). The server logs it plainly:
level=WARN message="failed to initialize fff" error="Failed to init file picker:
Can not run certain FFF features in a file system root or home directories.
Consider smaller per-project directories."
Reproducible straight from curl — same server, same flags, only the directory differs:
So it is not that the endpoint is broken generally — it is empty specifically under $HOME, which is where the picker starts. This also explains the workaround people keep rediscovering (typing ~/projects or an absolute path): any input with a / switches to file.list and works.
Related: #39655 reports the same symptom and includes the identical FFF log line; #39434 attributes it to a missing path param, which I could not confirm here — on 1.18.9 the request is well-formed and returns 200 with an empty array rather than a 400.
Fix
Listing the directory when the filter is empty is enough — match(directory, "", 50) already handles the empty-query case and routes through file.list. A non-empty filter keeps using file.find as before.
Verified on the reproduction: Add Project now opens showing /mnt/data/chat under Recent projects plus the home directory's folders, instead of "No folders found". Added two unit tests to directory-picker-domain.test.ts — one asserting the empty filter lists via file.list and never calls file.find, one asserting a non-empty filter still fuzzy-finds. The first fails on unmodified dev and passes with the change; packages/app unit tests go 692 -> 694 passing with no new failures.
Glad to open a PR if that's wanted — I see #37612 is already open against this issue.
Activity
github-actions commentedon Jul 18, 2026
This issue might be a duplicate of existing issues. Please check:
opencode webAdd Project picker returns no results when query is empty (find file query="" results=0), making project selection fail on first open.lilxckd-cloud commentedon Jul 30, 2026
Independent reproduction on 1.18.9 (arm64, Jetson / Ubuntu 20.04). Confirming this, and I think I can add the missing piece of why the empty query returns nothing.
The empty filter takes a different code path from a typed one
packages/app/src/components/directory-picker-domain.ts, increateDirectorySearch:An empty filter is not
pathInput, so it goes tofile.find. Anything containing/goes tofile.list. That asymmetry is the whole bug:file.listworks fine,file.finddoes not, in exactly the directory the picker opens on.Why
file.findreturns empty therefile.findis backed by the FFF index, which refuses to run in a home directory or the filesystem root — the two places the picker defaults to (dialog-select-directory-v2.tsxusessync.data.path.home || sync.data.path.directory). The server logs it plainly:Reproducible straight from curl — same server, same flags, only the directory differs:
So it is not that the endpoint is broken generally — it is empty specifically under
$HOME, which is where the picker starts. This also explains the workaround people keep rediscovering (typing~/projectsor an absolute path): any input with a/switches tofile.listand works.Related: #39655 reports the same symptom and includes the identical FFF log line; #39434 attributes it to a missing
pathparam, which I could not confirm here — on 1.18.9 the request is well-formed and returns200with an empty array rather than a 400.Fix
Listing the directory when the filter is empty is enough —
match(directory, "", 50)already handles the empty-query case and routes throughfile.list. A non-empty filter keeps usingfile.findas before.Verified on the reproduction: Add Project now opens showing
/mnt/data/chatunder Recent projects plus the home directory's folders, instead of "No folders found". Added two unit tests todirectory-picker-domain.test.ts— one asserting the empty filter lists viafile.listand never callsfile.find, one asserting a non-empty filter still fuzzy-finds. The first fails on unmodifieddevand passes with the change;packages/appunit tests go 692 -> 694 passing with no new failures.Glad to open a PR if that's wanted — I see #37612 is already open against this issue.
EricZhou05 commentedon Aug 11, 2026
Fixed in #41158.
github-actions commentedon Oct 10, 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.