Skip to content

armgit / ruflo

Public Imported from GitHub
0

🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated

Checkpoint: File edits

rUv4d325c33e30e
diff --git a/v3/@claude-flow/cli/src/commands/daemon.ts b/v3/@claude-flow/cli/src/commands/daemon.ts
index a3fd30aa98..4658a15a86 100644
--- a/v3/@claude-flow/cli/src/commands/daemon.ts
+++ b/v3/@claude-flow/cli/src/commands/daemon.ts
@@ -219,37 +219,27 @@ async function startBackgroundDaemon(projectRoot: string, quiet: boolean): Promi
env: { ...process.env, CLAUDE_FLOW_DAEMON: '1' },
});
- // Wait for the PID to be echoed back
- return new Promise((resolve) => {
- let pidStr = '';
- child.stdout?.on('data', (data: Buffer) => {
- pidStr += data.toString();
- });
-
- child.on('close', () => {
- const pid = parseInt(pidStr.trim(), 10);
-
- if (isNaN(pid) || pid <= 0) {
- output.printError('Failed to get daemon PID');
- resolve({ success: false, exitCode: 1 });
- return;
- }
+ // Get PID from spawned process directly (no shell echo needed)
+ const pid = child.pid;
- // Save PID
- fs.writeFileSync(pidFile, String(pid));
+ if (!pid || pid <= 0) {
+ output.printError('Failed to get daemon PID');
+ return { success: false, exitCode: 1 };
+ }
- if (!quiet) {
- output.printSuccess(`Daemon started in background (PID: ${pid})`);
- output.printInfo(`Logs: ${logFile}`);
- output.printInfo(`Stop with: claude-flow daemon stop`);
- }
+ // Save PID
+ fs.writeFileSync(pidFile, String(pid));
+
+ if (!quiet) {
+ output.printSuccess(`Daemon started in background (PID: ${pid})`);
+ output.printInfo(`Logs: ${logFile}`);
+ output.printInfo(`Stop with: claude-flow daemon stop`);
+ }
- resolve({ success: true });
- });
+ // Unref so parent can exit immediately
+ child.unref();
- // Unref so parent can exit immediately
- child.unref();
- });
+ return { success: true };
}
// Stop daemon subcommand