anomalyco / anomalyco/opencode

fix(core): honor repository ignores when selecting persistent FFF

Open
#44,278 1 comment 0 reactions 1 assignee View on GitHub

@kitlangton is already working on this.

Since Aug 23, 2026.

2.0
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
  1. Create a Git repository containing an ignored child directory, such as /ignored/.
  2. Populate ignored/ with a large directory tree.
  3. Open repo/ignored directly as an OpenCode Location.
  4. Confirm with git check-ignore that the Location is ignored.
  5. Count the server's inotify watches under /proc/<pid>/fdinfo.
  6. 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

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.