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
- Open a project at filesystem root
- File watcher attempts to watch the entire root directory
- 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.)
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
Expected Behavior
File watcher should skip filesystem roots and system directories.
Actual Behavior
File watcher attempts to watch roots, wasting resources.
System Info
Fix
Added isRootOrSystemDirectory check in packages/core/src/filesystem/watcher.ts to skip roots (C:/, /, etc.)