fix(agents): cache bootstrap snapshots per session key

Co-authored-by: Isis Anisoptera <github@lotuswind.net>
This commit is contained in:
Peter Steinberger
2026-02-23 19:04:54 +00:00
parent 8b3eee71ec
commit 40db3fef49
5 changed files with 136 additions and 4 deletions

View File

@@ -1,6 +1,7 @@
import { randomUUID } from "node:crypto";
import fs from "node:fs";
import { resolveDefaultAgentId } from "../../agents/agent-scope.js";
import { clearBootstrapSnapshot } from "../../agents/bootstrap-cache.js";
import { abortEmbeddedPiRun, waitForEmbeddedPiRunEnd } from "../../agents/pi-embedded.js";
import { stopSubagentsForRequester } from "../../auto-reply/reply/abort.js";
import { clearSessionQueues } from "../../auto-reply/reply/queue.js";
@@ -185,6 +186,7 @@ async function ensureSessionRuntimeCleanup(params: {
queueKeys.add(params.sessionId);
}
clearSessionQueues([...queueKeys]);
clearBootstrapSnapshot(params.target.canonicalKey);
stopSubagentsForRequester({ cfg: params.cfg, requesterSessionKey: params.target.canonicalKey });
if (!params.sessionId) {
return undefined;