Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion v3/@claude-flow/cli/bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,11 @@ if (isMCPMode) {
// Run normal CLI mode
const { CLI } = await import('../dist/src/index.js');
const cli = new CLI();
cli.run().catch((error) => {
// Fix #1428: ONNX/WASM worker threads keep the event loop alive after commands
// complete. Force-exit here (the true entry point) so all commands benefit.
cli.run().then(() => {
process.exit(0);
}).catch((error) => {
console.error('Fatal error:', error.message);
process.exit(1);
});
Expand Down
11 changes: 2 additions & 9 deletions v3/@claude-flow/cli/src/commands/memory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const BACKENDS = [
{ value: 'memory', label: 'In-Memory', hint: 'Fast but non-persistent' }
];


// Store command
const storeCommand: Command = {
name: 'store',
Expand Down Expand Up @@ -850,7 +851,7 @@ const cleanupCommand: Command = {

if (!confirmed) {
output.printInfo('Cleanup cancelled');
return { success: true, data: result };
return { success: true, data: result };
}
}

Expand Down Expand Up @@ -1446,14 +1447,6 @@ const initMemoryCommand: Command = {
output.writeln(output.dim(`Synced to: ${claudeDbPath}`));
}

// Fix #1428: ONNX worker threads keep the event loop alive after init.
// Force-exit after a short delay to allow final I/O to flush.
if (typeof globalThis !== 'undefined') {
setTimeout(() => {
process.exit(0);
}, 500).unref();
}

return {
success: true,
data: result
Expand Down