fix(delegate-task): ensure subagentSessions cleanup on all exit paths

Added outer finally block so subagentSessions.delete(syncSessionID)
runs even on early return from sendSyncPrompt error.
This commit is contained in:
YeonGyu-Kim 2026-02-11 00:43:43 +09:00
parent ea1b22454d
commit 7427922e6f

View File

@ -133,9 +133,6 @@ session_id: ${sessionID}
if (toastManager && taskId !== undefined) {
toastManager.removeTask(taskId)
}
if (syncSessionID) {
subagentSessions.delete(syncSessionID)
}
}
} catch (error) {
return formatDetailedError(error, {
@ -145,5 +142,9 @@ session_id: ${sessionID}
agent: agentToUse,
category: args.category,
})
} finally {
if (syncSessionID) {
subagentSessions.delete(syncSessionID)
}
}
}