fix(background-agent): bound session abort waits

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-04-04 01:19:52 +09:00
parent 938c920092
commit f5740d68c7
5 changed files with 45 additions and 11 deletions
@@ -238,7 +238,7 @@ function stubNotifyParentSession(manager: BackgroundManager): void {
}
async function flushBackgroundNotifications(): Promise<void> {
for (let i = 0; i < 6; i++) {
for (let i = 0; i < 12; i++) {
await Promise.resolve()
}
}
@@ -2570,7 +2570,7 @@ describe("BackgroundManager - Non-blocking Queue Integration", () => {
abortCalled,
new Promise<never>((_, reject) => setTimeout(() => reject(new Error("timeout")), 100)),
])
await Promise.resolve()
await flushBackgroundNotifications()
// then
const updatedTask = manager.getTask(task.id)