fix(background-agent): clear pending parent on silent cancel

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 11:04:35 +09:00
parent d253f267c3
commit 4157c2224f
2 changed files with 2 additions and 0 deletions

View File

@@ -105,6 +105,7 @@ describe("BackgroundManager.cancelTask cleanup", () => {
// then
expect(cancelled).toBe(true)
expect(getPendingByParent(manager).get(task.parentSessionID)).toBeUndefined()
runScheduledCleanup(manager, task.id)
expect(manager.getTask(task.id)).toBeUndefined()
})

View File

@@ -1242,6 +1242,7 @@ export class BackgroundManager {
removeTaskToastTracking(task.id)
if (options?.skipNotification) {
this.cleanupPendingByParent(task)
this.scheduleTaskRemoval(task.id)
log(`[background-agent] Task cancelled via ${source} (notification skipped):`, task.id)
return true