anomalyco / anomalyco/opencode
fix(core): honor repository ignores when selecting persistent FFF
@kitlangton is already working on this.
Since Aug 23, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
OpenCode enables FFF for a VCS Location and passes location.directory as its basePath. If the selected Location is ignored by its nearest repository, FFF still treats it as an explicit traversal root and recursively indexes and watches it.
In the observed case, the nearest worktree root was ~, whose .gitignore contains **/**. git check-ignore confirmed that ~/repos/gw/monorepo.gwt was ignored, but opening that directory directly still created 33,619 FFF inotify watches.
Before creating a persistent index, OpenCode should evaluate the Location root using the effective ignore rules from its nearest repository. An ignored Location should remain explicitly searchable through bounded nonpersistent search, but should not receive persistent FFF watches. Ignore rules above the nearest repository root should not apply.
Related: #44266 and #37740.
Plugins
@onshape-mcp/opencode-auth, local claude-plugin.js
OpenCode version
opencode2 v0.0.0-v2-202608222142, commit 1f60ad6e2f
Steps to reproduce
- Create a Git repository containing an ignored child directory, such as
/ignored/. - Populate
ignored/with a large directory tree. - Open
repo/ignoreddirectly as an OpenCode Location. - Confirm with
git check-ignorethat the Location is ignored. - Count the server's inotify watches under
/proc/<pid>/fdinfo. - Observe that FFF indexes and watches the ignored Location.
Screenshot and/or share link
No screenshot. The observed 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.