Skip to content

fix(core): skip file watcher on filesystem roots #45611

Description

@CannonRS

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.)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions