The auto-watcher keeps the index fresh by watching the workspace for file changes. On macOS the fsnotify kqueue backend opens one file descriptor per watched file, so these caps bound fd usage on trees that contain large data/cache directories (see #18).
Variable
Default
Description
AGENT_LSP_DISABLE_WATCHER
(unset)
Set to 1/true to disable the auto-watcher entirely. Clients still receive explicit did_change_watched_files. Use when a workspace is very large or contains actively-written data directories.
AGENT_LSP_WATCH_MAX_DIR_ENTRIES
2048
Skip watching any single directory with more than this many entries (data/cache dirs that would open thousands of fds on macOS).
AGENT_LSP_WATCH_MAX_ENTRIES
50000
Global budget on total watched entries (≈ file descriptors on macOS). Once reached, the walk stops and remaining files rely on explicit refresh. Raise on very large source trees.
AGENT_LSP_WATCH_MAX_FDS
60000
Runtime guard: the watcher samples the process's open file descriptors every 30s and tears itself down if the count exceeds this, catching descriptors that fsnotify opens for files created while running (which the startup budget above cannot see). Well below the macOS per-process limit (245,760). Raise on very large source trees.