fix: tighten session entry updates

Co-authored-by: Tyler Yust <tyler6204@users.noreply.github.com>
This commit is contained in:
Peter Steinberger
2026-01-15 23:09:47 +00:00
parent a4b347b454
commit 10eb1beccf
5 changed files with 64 additions and 52 deletions

View File

@@ -400,6 +400,9 @@ export async function runAgentTurnWithFallback(params: {
}
}
// Keep the in-memory snapshot consistent with the on-disk store reset.
delete params.activeSessionStore[sessionKey];
// Remove session entry from store using a fresh, locked snapshot.
await updateSessionStore(params.storePath, (store) => {
delete store[sessionKey];