v1.18.9 Enhanced process management and resource cleanup
Fixed
-
Process Management: Enhanced graceful shutdown mechanism for MCP server
- Added comprehensive signal handlers (SIGINT, SIGTERM, SIGHUP)
- Added Windows-specific shutdown message handling
- Added uncaught exception and unhandled rejection handlers
- Improved resource cleanup on server termination
- Prevents orphaned processes when IDE closes unexpectedly
-
Daemon Module Loading: Fixed potential unintended daemon startup
- Improved module execution detection logic in
daemon.ts - More strict validation to prevent daemon startup when imported as module
- Only starts when explicitly executed as entry point
- Prevents accidental daemon spawning in edge cases
- Improved module execution detection logic in
-
Resource Cleanup: Enhanced daemon watcher cleanup mechanism
- Added fallback method for chokidar watcher cleanup (
unwatch) - Improved watcher array cleanup with proper iteration
- Added explicit database connection closure in daemon stop
- Better cleanup logging for debugging
- Resolves potential file watcher leaks on Windows
- Added fallback method for chokidar watcher cleanup (
Added
- CLI Tool: New
cleanupcommand for process managementdevmind cleanup- Lists all DevMind-related Node.js processesdevmind cleanup --dry-run- Preview processes without killingdevmind cleanup --force- Kill processes without confirmation- Cross-platform support (Windows and Unix/Linux/Mac)
- Interactive confirmation for safety
- Emergency tool for resolving orphaned process issues
Technical Details
- Improved Windows platform compatibility for process lifecycle management
- Enhanced error handling in daemon resource cleanup
- Added defensive programming patterns to prevent edge-case process leaks
- All changes are backward compatible
Why This Update?
While the architecture was already correct (MCP server doesn't start daemon), these improvements:
- Add defense-in-depth for process management on Windows
- Provide users with emergency cleanup tools
- Improve system robustness under abnormal termination scenarios
- Ensure clean shutdown even when IDE crashes or kills processes