fix(session-category-registry): cleanup entries for task sessions
This commit is contained in:
parent
d947743932
commit
cd3e0ca124
@ -16,6 +16,7 @@ import {
|
|||||||
createInternalAgentTextPart,
|
createInternalAgentTextPart,
|
||||||
} from "../../shared"
|
} from "../../shared"
|
||||||
import { setSessionTools } from "../../shared/session-tools-store"
|
import { setSessionTools } from "../../shared/session-tools-store"
|
||||||
|
import { SessionCategoryRegistry } from "../../shared/session-category-registry"
|
||||||
import { ConcurrencyManager } from "./concurrency"
|
import { ConcurrencyManager } from "./concurrency"
|
||||||
import type { BackgroundTaskConfig, TmuxConfig } from "../../config/schema"
|
import type { BackgroundTaskConfig, TmuxConfig } from "../../config/schema"
|
||||||
import { isInsideTmux } from "../../shared/tmux"
|
import { isInsideTmux } from "../../shared/tmux"
|
||||||
@ -859,6 +860,7 @@ export class BackgroundManager {
|
|||||||
subagentSessions.delete(task.sessionID)
|
subagentSessions.delete(task.sessionID)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
SessionCategoryRegistry.remove(sessionID)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1022,6 +1024,8 @@ export class BackgroundManager {
|
|||||||
this.client.session.abort({
|
this.client.session.abort({
|
||||||
path: { id: task.sessionID },
|
path: { id: task.sessionID },
|
||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
|
|
||||||
|
SessionCategoryRegistry.remove(task.sessionID)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (options?.skipNotification) {
|
if (options?.skipNotification) {
|
||||||
@ -1169,6 +1173,8 @@ export class BackgroundManager {
|
|||||||
this.client.session.abort({
|
this.client.session.abort({
|
||||||
path: { id: task.sessionID },
|
path: { id: task.sessionID },
|
||||||
}).catch(() => {})
|
}).catch(() => {})
|
||||||
|
|
||||||
|
SessionCategoryRegistry.remove(task.sessionID)
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -1471,6 +1477,7 @@ Use \`background_output(task_id="${task.id}")\` to retrieve this result when rea
|
|||||||
this.tasks.delete(taskId)
|
this.tasks.delete(taskId)
|
||||||
if (task.sessionID) {
|
if (task.sessionID) {
|
||||||
subagentSessions.delete(task.sessionID)
|
subagentSessions.delete(task.sessionID)
|
||||||
|
SessionCategoryRegistry.remove(task.sessionID)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user