anomalyco / anomalyco/opencode

fix(core): skip file watcher on filesystem roots

Open
#45,611 1 comment 0 reactions 1 assignee View on GitHub

@jlongster is already working on this.

Since Aug 27, 2026.

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

Description

Description

The file watcher attempts to watch filesystem roots (e.g., C:/ on Windows, / on Linux) which causes unnecessary resource usage and potential permission issues.

Reproduction Steps

  1. Open a project at filesystem root
  2. File watcher attempts to watch the entire root directory
  3. Causes high resource usage / permission errors

Expected Behavior

File watcher should skip filesystem roots and system directories.

Actual Behavior

File watcher attempts to watch roots, wasting resources.

System Info

  • OS: Linux/macOS/Windows
  • opencode version: dev

Fix

Added isRootOrSystemDirectory check in packages/core/src/filesystem/watcher.ts to skip roots (C:/, /, etc.)

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.