🔖 Checkpoint: Edit /workspaces/claude-code-flow/src/cli/simple-commands/hive-mind/session-manager.js

This commit is contained in:
rUv committed 2025-08-05 01:17:49 +00:00
1 parent 8230b934a0
commit c70bf3bef4
3 files changed
+39

No files matched your search

+1
View File
@@ -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"}
+1
View File
@@ -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(-) "}
@@ -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;