fix(background-agent): clean global subagentSessions and SessionCategoryRegistry on dispose

This commit is contained in:
YeonGyu-Kim
2026-03-13 10:56:44 +09:00
parent 0015dd88af
commit 457f303adf
4 changed files with 198 additions and 0 deletions
+4
View File
@@ -319,6 +319,7 @@ export function createEventHandler(args: {
}
if (sessionInfo?.id) {
const wasSyncSubagentSession = syncSubagentSessions.has(sessionInfo.id);
clearSessionAgent(sessionInfo.id);
lastHandledModelErrorMessageID.delete(sessionInfo.id);
lastHandledRetryStatusKey.delete(sessionInfo.id);
@@ -329,6 +330,9 @@ export function createEventHandler(args: {
firstMessageVariantGate.clear(sessionInfo.id);
clearSessionModel(sessionInfo.id);
syncSubagentSessions.delete(sessionInfo.id);
if (wasSyncSubagentSession) {
subagentSessions.delete(sessionInfo.id);
}
deleteSessionTools(sessionInfo.id);
await managers.skillMcpManager.disconnectSession(sessionInfo.id);
await lspManager.cleanupTempDirectoryClients();