Skip to content

fix(watcher): improve FSEvents error message with actionable suggestions#10111

Merged
davidfirst merged 3 commits intomasterfrom
fix/fsevents-error-message
Dec 3, 2025
Merged

fix(watcher): improve FSEvents error message with actionable suggestions#10111
davidfirst merged 3 commits intomasterfrom
fix/fsevents-error-message

Conversation

@davidfirst
Copy link
Member

When the macOS FSEvents stream limit is reached, the error message now:

  • Detects and lists all running Bit watcher processes with their PIDs and working directories
  • Distinguishes between killable processes (bit watch/start/run) and VSCode extension servers
  • Provides a ready-to-copy kill command for non-VSCode processes
  • Suggests closing unused VSCode windows for extension-managed servers
  • Explains that each process may consume multiple FSEvents streams internally

Example output:

Failed to start the watcher: Error starting FSEvents stream
macOS limits the total number of FSEvents watchers system-wide (undocumented limit, typically ~500).
Each running watcher process may consume multiple streams internally.

Found the following Bit watcher processes:
  PID 65269: node /Users/user/bin/bit start (/Users/user/project)
  PID 77282: node /Users/user/bin/bit watch (/private/tmp/workspace)
  PID 65084: node /Users/user/bin/bit server --compile (/Users/user/vscode-project) [VSCode extension]

To free up FSEvents streams, you can:
  1. Close unnecessary terminal tabs running bit watch/start/run
  2. Kill specific processes: kill 65269 77282
  3. Close unused VSCode windows (1 VSCode Bit server running)

When macOS FSEvents stream limit is reached, detect running bit watcher
processes and provide specific suggestions including PIDs and kill commands.
Distinguish between killable processes and VSCode extension servers.
Copilot AI review requested due to automatic review settings December 3, 2025 20:28
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the FSEvents watcher error message to provide actionable diagnostics when the macOS FSEvents stream limit is reached. Instead of a generic error, it now detects running Bit watcher processes, distinguishes between user-manageable and VS Code extension-managed servers, and provides ready-to-use commands to free up FSEvents streams.

Key changes:

  • Added process detection that lists all running Bit watcher processes with PIDs and working directories
  • Distinguishes between killable processes (bit watch/start/run) and VS Code extension servers
  • Provides ready-to-copy kill commands and actionable suggestions

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
scopes/workspace/watcher/fsevents-error.ts New module containing logic to detect running Bit watcher processes and format enhanced FSEvents error messages
scopes/workspace/watcher/watcher.ts Integrated the new error formatter in two error handling paths (direct watcher and daemon mode)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Use ps -eo for more predictable output parsing
- Add PID validation to prevent command injection
- Use consistent 'VS Code' branding (with space)
- Align regex pattern for bit server detection
@davidfirst
Copy link
Member Author

All Copilot review comments have been addressed in commit 3a3bf63:

  1. Command injection risk - Added explicit PID validation with /^\d+$/.test(pidStr) before using in shell command
  2. VS Code branding - Changed to "VS Code" (with space) consistently throughout
  3. Fragile ps parsing - Switched to ps -eo pid,command for more predictable output format
  4. Inconsistent regex - Changed to /bit server(?:\s|$)/ to align with the grep pattern

@davidfirst davidfirst merged commit 823f009 into master Dec 3, 2025
12 checks passed
@davidfirst davidfirst deleted the fix/fsevents-error-message branch December 3, 2025 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants