From c70bf3bef4fd43f0ce71dae65e212f8e3cfc2bef Mon Sep 17 00:00:00 2001 From: rUv Date: Tue, 5 Aug 2025 01:17:49 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=96=20Checkpoint:=20Edit=20/workspaces?= =?UTF-8?q?/claude-code-flow/src/cli/simple-commands/hive-mind/session-man?= =?UTF-8?q?ager.js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .claude/checkpoints/1754356649.json | 1 + .claude/checkpoints/1754356651.json | 1 + .../hive-mind/session-manager.js | 37 +++++++++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 .claude/checkpoints/1754356649.json create mode 100644 .claude/checkpoints/1754356651.json diff --git a/.claude/checkpoints/1754356649.json b/.claude/checkpoints/1754356649.json new file mode 100644 index 0000000000..19bce0a9c1 --- /dev/null +++ b/.claude/checkpoints/1754356649.json @@ -0,0 +1 @@ +{"branch": "checkpoint/pre-edit-20250805-011729", "file": "/workspaces/claude-code-flow/src/cli/simple-commands/hive-mind/session-manager.js", "timestamp": "2025-08-05T01:17:29Z", "type": "pre-edit", "original_branch": "alpha-85"} diff --git a/.claude/checkpoints/1754356651.json b/.claude/checkpoints/1754356651.json new file mode 100644 index 0000000000..be85c2e09e --- /dev/null +++ b/.claude/checkpoints/1754356651.json @@ -0,0 +1 @@ +{"tag": "checkpoint-20250805-011730", "file": "/workspaces/claude-code-flow/src/cli/simple-commands/hive-mind/session-manager.js", "timestamp": "2025-08-05T01:17:31Z", "type": "post-edit", "branch": "alpha-85", "diff_summary": " .claude-flow/metrics/performance.json | 2 +- .claude-flow/metrics/system-metrics.json | 12 ++++++++++++ .claude-flow/metrics/task-metrics.json | 6 +++--- .claude/checkpoints/1754356635.json | 1 + .claude/checkpoints/1754356637.json | 1 + claude-flow-wiki | 0 src/cli/simple-commands/hive-mind/session-manager.js | 8 ++++++++ 7 files changed, 26 insertions(+), 4 deletions(-) "} diff --git a/src/cli/simple-commands/hive-mind/session-manager.js b/src/cli/simple-commands/hive-mind/session-manager.js index fa438cdc7f..bb64cb5b10 100644 --- a/src/cli/simple-commands/hive-mind/session-manager.js +++ b/src/cli/simple-commands/hive-mind/session-manager.js @@ -868,6 +868,24 @@ To enable persistence, see: https://github.com/ruvnet/claude-code-flow/docs/wind * Add a child process PID to session */ async addChildPid(sessionId, pid) { + await this.ensureInitialized(); + + if (this.isInMemory) { + // Use in-memory storage + const session = this.memoryStore.sessions.get(sessionId); + if (!session) return false; + + const childPids = session.child_pids ? sessionSerializer.deserializeLogData(session.child_pids) : []; + if (!childPids.includes(pid)) { + childPids.push(pid); + } + session.child_pids = sessionSerializer.serializeLogData(childPids); + session.updated_at = new Date().toISOString(); + + await this.logSessionEvent(sessionId, 'info', 'Child process added', null, { pid }); + return true; + } + const session = this.db.prepare('SELECT child_pids FROM sessions WHERE id = ?').get(sessionId); if (!session) return false; @@ -892,6 +910,25 @@ To enable persistence, see: https://github.com/ruvnet/claude-code-flow/docs/wind * Remove a child process PID from session */ async removeChildPid(sessionId, pid) { + await this.ensureInitialized(); + + if (this.isInMemory) { + // Use in-memory storage + const session = this.memoryStore.sessions.get(sessionId); + if (!session) return false; + + const childPids = session.child_pids ? sessionSerializer.deserializeLogData(session.child_pids) : []; + const index = childPids.indexOf(pid); + if (index > -1) { + childPids.splice(index, 1); + } + session.child_pids = sessionSerializer.serializeLogData(childPids); + session.updated_at = new Date().toISOString(); + + await this.logSessionEvent(sessionId, 'info', 'Child process removed', null, { pid }); + return true; + } + const session = this.db.prepare('SELECT child_pids FROM sessions WHERE id = ?').get(sessionId); if (!session) return false;