Open
Conversation
Introduce a lazy proxy for the shared EnhancedMCPTools singleton so importing the module does not create the SQLite pool up front. Update each CLI entry point to reuse the initialized toolset, guard against triggering the lazy proxy, and call process.exit(0) for help/version flows. These changes keep non-operational commands like --help and --version from initializing persistence and ensure they terminate immediately.
Author
|
This also fixes |
Author
|
Added another fix for ruv-swarm status and other commands hanging
|
* Made RuvSwarm.destroy() async, awaiting agent termination, pooled persistence shutdown, and WASM cleanup so connections are released before exit (npm/src/index-enhanced.js:39). * Taught the singleton container to await async destroy/clear/reset, and adjusted global teardown hooks plus resetContainer() to cope with promises (npm/src/singleton-container.js:83). * Refreshed the container’s test harness to operate asynchronously and to await the new async lifecycle methods (npm/test/singleton-container.test.js:27).
Refactor the command entry points to register shared cleanup handlers and run them once at the end of execution, instead of sprinkling per-command process exits. Neural commands now rely on an explicit cleanup hook while EnhancedMCPTools and ClaudeFlowEnhanced expose asynchronous destroy() methods so pooled SQLite workers close reliably. Singleton container tests were updated to await the async lifecycle.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before when running
ruv-swarm --helphelp was printed but then the process hangs.EnhancedMCPToolssingleton by wrapping the default export in a lazy proxy. Importingmcp-tools-enhanced.jsnow leaves SQLite pools closed until the first real method call.process.exit(0)after printing help or version` output so these code paths terminate promptly.