Skip to content

desktop: directory picker submits home directory instead of typed path when adding a project #59589

Closed

Description

@kukenitc2-lang

Summary

In the "Open project" (Add project) directory picker, typing an absolute path (e.g. F:\Video-Edit) and clicking Select folder without first clicking the matching suggestion row submits the server's default location (C:\Users\<user>) instead of the typed path. The app then switches to the drive-root project C:/ (project id global), so "Add project" always lands on C:.

Environment

  • opencode version: 2.2.0 (OpenCode Desktop, bundled opencode-cli.exe, Electron 44.9.1 / Chrome 152)
  • OS: Windows 11 (Windows_NT 10.0.26200, win32 x64)
  • Terminal: Unavailable — reproduced in the desktop app (v2 web UI served by the background service), not a terminal
  • Shell: cmd.exe (system default)
  • Install/channel: desktop, channel latest
  • Active plugins: none found in ~/.config/opencode/opencode.jsonc (only MCP servers configured)

Reproduction

  1. Open the v2 web UI served by the desktop's background service (e.g. via an opencode pair link) and go to Home.
  2. Click Add project. The in-app "Open project" dialog opens; the footer/selection line shows the home directory (C:\Users\<user>).
  3. Type an absolute path on another drive, e.g. F:\Video-Edit, into the search input. Suggestions appear (F:\Video-Edit/, its subfolders, ...). Do not click a suggestion.
  4. Click Select folder.
  5. Watch the network tab: the app sends GET /api/location?location[directory]=C%3A%5CUsers%5C%3Cuser%3E (HTTP 200) — the typed path is ignored.
  6. Home switches to the project C: (worktree C:/, id global).

Verified working alternative: click the suggestion row F:\Video-Edit/ first (the footer line changes to F:\Video-Edit), then click Select folder — the request is then GET /api/location?location[directory]=F:\Video-Edit.

Note: pressing ArrowDown only sets the highlighted (active) suggestion; with an active-but-not-chosen suggestion, Select folder still submitted the home directory in my test.

Expected Behavior

Select folder should submit the typed path (or the active suggestion), i.e. resolve F:\Video-Edit — or refuse to submit while the input contains an unconfirmed path.

Actual Behavior

The dialog submits the server default location directory. The server resolves it to the drive-root project and the client switches selection to it:

  • Sent: GET /api/location?location[directory]=C:\Users\<user> → 200
  • Response: {"directory":"C:\\Users\\<user>","project":{"id":"global","directory":"C:\\","canonical":"C:\\"}}
  • Home selection becomes the C:/ project.

For comparison, the server itself resolves paths correctly — the bug is client-side state handling in DirectoryPickerDialog (submit uses the current selection, defaulting to the home root, instead of the input text / active suggestion):

GET /api/location?location[directory]=F:\Video-Edit
→ {"directory":"F:\\Video-Edit","project":{"id":"d72c10…","directory":"F:\\Video-Edit","canonical":"F:\\Video-Edit"}}

Additional Context

  • Frequency: 100% reproducible via the in-app (server-kind) picker on Windows.
  • Workaround: click the suggestion row first so the footer shows the intended path, then Select folder; or resolve the directory via the API/CLI directly.
  • Related annoyance: the global (C:/) project keeps reappearing in Home because default-location bootstraps (GET /api/location with no directory) touch it on every relevant page load.
  • The desktop-native flow (Electron openDirectory picker) was not separately verified in this session; this report covers the in-app DirectoryPickerDialog served at the v2 web UI.

Activity

  1. opencode-agent commented on Oct 27, 2026

    @opencode-agent
    Contributor

    Thanks for the detailed report, and for including the workaround.

    In the current picker, the search box is for finding and navigating to a folder: pressing Enter, pressing Tab or clicking a suggestion moves the picker there. Select folder submits whatever the footer line shows, which is the folder you're browsing (your home folder when the dialog opens). So the dialog is doing what it was built to do, but I agree it's easy to trip over when you type a full path and click Select folder straight away.

    I've filed this as a request for Select folder to use the typed path or highlighted suggestion, or to stay disabled while the input holds a path that hasn't been confirmed. Maintainers will consider it.

    Related issues:

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

Metadata

Metadata

Assignees

No one assigned

    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