You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
.watchman-cookie-* files in git worktrees cause periodic /vcs/diff requests #24357
When using secondary workspaces (git worktrees), .watchman-cookie-* files created by Watchman at the worktree root trigger the file watcher. This leads to frequent refreshVcs() calls and periodic requests to /vcs/diff.
This can be annoying when attempting to comment on the code because the file will refresh, losing anything typed in the comment.
Root cause(s)
.watchman-cookie-* files are not ignored by default (they likely should be).
The watcher.ignore config option is only applied to the project directory subscription, not to the .git directory subscription used for worktrees.
Proposed Fix
Update packages/opencode/src/file/watcher.ts to apply config ignores to the VCS directory subscription:
// Currently:yield*subscribe(vcsDir,ignore)// Should be:yield*subscribe(vcsDir,[...ignore, ...cfgIgnores])Additionally,add.watchman-cookie-*tothedefaultignorepatternsinsrc/file/ignore.ts.
Workaround
Disabling the watcher with OPENCODE_EXPERIMENTAL_DISABLE_FILEWATCHER=true
Plugins
obra/superpowers
OpenCode version
1.14.23
Steps to reproduce
Use a project with "workspaces" enabled (secondary git worktree).
Let Watchman run (creates .watchman-cookie-* files in the secondary worktree root).
Observe periodic /vcs/diff requests in network tab or server logs.
This issue might be a duplicate of existing issues. Please check:
fix: review panel flickers/rerenders on every filesystem event including ignored paths #21452: Describes the same root cause — events from worktree and git-dir subscriptions not being filtered through ignore patterns, leading to spurious refreshVcs() calls. The fix described there includes moving ignore filtering into each subscription and handling git-dir worktree paths properly, which overlaps significantly with the fix proposed here.
Activity
github-actions commentedon Apr 25, 2026
This issue might be a duplicate of existing issues. Please check:
refreshVcs()calls. The fix described there includes moving ignore filtering into each subscription and handling git-dir worktree paths properly, which overlaps significantly with the fix proposed here.watcher.ignoreconfig is not applied to the underlying watch setup, causing ignore patterns to be ineffective — similar to the second root cause described here.It may be worth coordinating with the authors/assignees of those issues before implementing a separate fix.
github-actions commentedon Jul 3, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.