anomalyco / anomalyco/opencode
fix(core): extend FFF home protection to descendant locations
@nexxeln is already working on this.
Since Aug 22, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
When a Location below ~ belongs to a Git worktree rooted at ~, OpenCode currently enables persistent FFF because eligibility checks whether location.directory itself equals home.
In the observed case, opening a broad directory below home created 33,619 FFF inotify watches. Falling back to bounded ripgrep reduced the server to four watches.
FFF eligibility should instead inspect the nearest worktree root, location.project.directory, and disable persistent indexing when that worktree contains home. This includes worktrees rooted at ~ or an ancestor of ~. A genuine nested repository below home remains eligible because its nearest worktree does not contain home.
An inclusive path.relative(worktree, home) containment check can implement this without path-prefix matching. The existing exact-home check for home-specific exclusion names should remain unchanged.
Related: #32511.
Plugins
@onshape-mcp/opencode-auth, local claude-plugin.js
OpenCode version
opencode2 v0.0.0-v2-202608222142, commit 1f60ad6e2f
Steps to reproduce
- Use a home directory that is a Git worktree.
- Open an OpenCode Location below home that has no nearer VCS root.
- Count the server's inotify watches under
/proc/<pid>/fdinfo. - Observe that FFF is enabled because the selected Location is not exactly home.
Screenshot and/or share link
No screenshot. The server used 33,637 watches, of which 33,619 belonged to its main FFF descriptor.
Operating System
Ubuntu Linux, kernel 7.0.0-29-generic, x86-64
Terminal
xterm-256color, terminal application unavailable
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.