Skip to content

/api/fs/find returns empty results when location.directory is /, making the "Open project" picker unusable #57435

Closed as not planned

Description

@Sreimu

Description

When the server's current project is the pseudo-project global (worktree /),
GET /api/fs/find returns {"data":[]} for every query, so the "Open project"
dialog (mod+o) shows an empty list and no project can ever be added from the web UI.

/api/fs/list at the same location works fine, so it is not a permission or
visibility problem — it is specific to find.

Plugins

No response

OpenCode version

1.19.0 (web frontend bundle reports 1.18.35)

Steps to reproduce

  1. Run the server from a directory that is not inside a git repository, so the
    current project resolves to global with worktree /:

    mkdir -p /tmp/ws && cd /tmp/ws && opencode web --port 4096
    
  2. Compare list and find at the same location:

    # works — returns bin/, dev/, etc/, home/, ...
    curl -G 'http://localhost:4096/api/fs/list' \
         --data-urlencode 'location[directory]=/'
    
    # always empty, for any query, with or without `type` / `limit`
    curl -G 'http://localhost:4096/api/fs/find' \
         --data-urlencode 'location[directory]=/' \
         --data-urlencode 'query=etc' \
         --data-urlencode 'type=directory'
    

    Response:
    {"location":{"directory":"/","project":{"id":"global","directory":"/"}},"data":[]}

    Also empty for query=workspace, tmp, usr, bin, lib, a — and with limit=100.

  3. Same query with a non-root location returns results as expected:

    curl -G 'http://localhost:4096/api/fs/find' \
         --data-urlencode 'location[directory]=/tmp/ws' \
         --data-urlencode 'query=etc' --data-urlencode 'type=directory'
    
  4. In the web UI, press mod+o ("Open project") and type anything: the list is
    empty. Since the picker has no "go up" action and roots at the current
    project directory, there is no way to add a project that is not a descendant
    of the current one — a dead end for a fresh install.

Screenshot

No response

Operating System

Alpine Linux 3.24.2 inside Docker (ghcr.io/anomalyco/opencode:1.19.0 + apk add git), host: Synology DSM 7.x

Terminal

Web UI

Activity

  1. opencode-agent commented on Oct 20, 2026

    @opencode-agent
    Contributor

    Thanks for the detailed report and the curl repro, it makes the problem very clear.

    OpenCode 1.19.0 is part of v1 (versions 0.x/1.x). v1 only gets fixes for critical bugs such as data loss, security problems or breakage with no workaround, so this is unlikely to be fixed there. For now you can start opencode web from your project directory, or from a parent folder other than / (for example a mounted workspace folder). The "Open project" picker searches from the folder the server was started in.

    We recommend moving to OpenCode v2 (npm package @opencode/cli, opencode command), where active development happens. Related issues you may want to follow:

    If this also happens on v2, or you think it's critical, please reply here with the v2 version and the same curl output.

  2. opencode-agent commented on Oct 21, 2026

    @opencode-agent
    Contributor

    Closing this as not planned. The report is for OpenCode 1.19.0, which is v1, and v1 only gets fixes for critical bugs. In the meantime, starting opencode web from your project directory (or a parent folder other than /) lets the "Open project" picker find folders again.

    If you see the same empty /api/fs/find results on v2 (@opencode/cli), please open a new issue with the v2 version and your curl repro, or reply here. Thanks again for the detailed report.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions