fix(call-omo-agent): preserve reused session tracking

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
YeonGyu-Kim
2026-03-12 02:24:22 +09:00
parent e249333898
commit 7997606892
2 changed files with 27 additions and 1 deletions
+3 -1
View File
@@ -46,10 +46,12 @@ export async function executeSync(
spawnReservation?: SpawnReservation,
): Promise<string> {
let sessionID: string | undefined
let createdSessionForExecution = false
try {
const session = await deps.createOrGetSession(args, toolContext, ctx)
sessionID = session.sessionID
createdSessionForExecution = session.isNew
if (session.isNew) {
spawnReservation?.commit()
@@ -100,7 +102,7 @@ export async function executeSync(
spawnReservation?.rollback()
throw error
} finally {
if (sessionID) {
if (sessionID && createdSessionForExecution) {
subagentSessions.delete(sessionID)
syncSubagentSessions.delete(sessionID)
}