anomalyco / anomalyco/opencode

fff file picker refuses to index home dir, breaking web UI project picker

Open
#37,961 2 comments 1 reaction 1 assignee View on GitHub

@kitlangton is already working on this.

Since Jul 20, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Problem

The opencode web UI 'Open project' modal calls /find/file?directory=<home>&query=&type=directory to populate the project picker. fff (the file finder) refuses to initialize when the basePath is the user's home directory:

Failed to init file picker: Can not run certain FFF features in a file system root or home directories. Consider smaller per-project directories.

This means the project picker search returns [] and users cannot find/open projects that live under their home directory (the common case). The modal only shows 'Recent projects' (2 entries from the project table), not the full list of available projects.

Root cause

FileFinder.create() supports enableHomeDirScanning: true and enableFsRootScanning: true options (see dmtrKovalenko/fff#588), but opencode calls it with the defaults (false). There is no env var or config option to override this:

  • No OPENCODE_ENABLE_HOME_SCAN or similar env var
  • No config field in opencode.json for fff options
  • OPENCODE_DISABLE_FFF=1 falls back to a readdir-based finder, but it (a) returns an array of strings instead of objects (UI expects {path, type, score}), and (b) returns [] for empty queries, so the modal still shows nothing.

Environment

  • opencode 1.17.11 (Bun binary)
  • WSL2 Debian, WorkingDirectory=/home/abdullah/repos (symlink to /mnt/c/Repos)
  • Projects stored under ~/repos, which equals $HOME/repos

Proposed fix

Expose enableHomeDirScanning / enableFsRootScanning via:

  1. Env vars (e.g. OPENCODE_FFF_ENABLE_HOME_SCAN=1), or
  2. A config field in opencode.json (e.g. "fff": {"enableHomeDirScanning": true}), or
  3. Auto-enable when the service's WorkingDirectory is inside $HOME (common for web deployments).

Workaround

None that works cleanly. Setting HOME to a dummy dir breaks the /path endpoint's home field (UI searches the wrong directory). Setting HOME to the repos dir makes fff refuse (basePath == homedir).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.