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:
@@ -105,6 +105,7 @@ describe("BackgroundManager.cancelTask cleanup", () => {
|
|||||||
|
|
||||||
// then
|
// then
|
||||||
expect(cancelled).toBe(true)
|
expect(cancelled).toBe(true)
|
||||||
|
expect(getPendingByParent(manager).get(task.parentSessionID)).toBeUndefined()
|
||||||
runScheduledCleanup(manager, task.id)
|
runScheduledCleanup(manager, task.id)
|
||||||
expect(manager.getTask(task.id)).toBeUndefined()
|
expect(manager.getTask(task.id)).toBeUndefined()
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1242,6 +1242,7 @@ export class BackgroundManager {
|
|||||||
removeTaskToastTracking(task.id)
|
removeTaskToastTracking(task.id)
|
||||||
|
|
||||||
if (options?.skipNotification) {
|
if (options?.skipNotification) {
|
||||||
|
this.cleanupPendingByParent(task)
|
||||||
this.scheduleTaskRemoval(task.id)
|
this.scheduleTaskRemoval(task.id)
|
||||||
log(`[background-agent] Task cancelled via ${source} (notification skipped):`, task.id)
|
log(`[background-agent] Task cancelled via ${source} (notification skipped):`, task.id)
|
||||||
return true
|
return true
|
||||||
|
|||||||
Reference in New Issue
Block a user