Skip to content

Bug: folder picker search anchored to home dir; cannot find projects on other drives (Windows) #43173

Closed as not planned

Description

@wh2237395

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

  1. On Windows, start opencode web from the root of D:\.
  2. Open the web UI → click "Open project" (add project).
  3. Type the name of a project that lives on D: (e.g. fleximetric at D:\code\python-demo\fleximetric).
  4. 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:\ returns results=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-demo and 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

Activity

  1. changed the title [-][Web UI] Folder picker search anchored to home dir; cannot find projects on other drives (Windows)[/-] [+]Bug: folder picker search anchored to home dir; cannot find projects on other drives (Windows)[/+] on Aug 18, 2026
  2. Annanxiao commented on Sep 17, 2026

    @Annanxiao

    Confirmed on Windows mobile Web UI (v1.18.18). /path reports home on C: while directory is on D:. /project, /session, and /find/file all see the D: project correctly, and a direct session URL opens on the same phone, but the mobile project picker cannot find/open it. This supports the reported frontend search-base bug. One extra detail: entering a full D-drive path in the mobile picker can still show 'No folder found', suggesting an additional mobile/path-parsing issue.

  3. wes1993 commented on Sep 17, 2026

    @wes1993

    Same on Linux with docker

  4. CodeJuggernaut commented on Oct 10, 2026

    @CodeJuggernaut

    Confirmed on windows, HOWEVER:

    There's a workaround. In the picker's search box, type C:\path\to\your\git\dir and press Enter, which moves the search there. Then type your directory name and it will appear. Click it and you're in!

  5. thdxr commented on Oct 11, 2026

    @thdxr
    Member

    Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.

    — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions