fix(background-agent): handle session.error and prevent zombie queue starts

Marks background tasks as error on session.error to release concurrency immediately, and skips/removes error tasks from queues to avoid zombie starts.
This commit is contained in:
YeonGyu-Kim
2026-02-12 18:26:03 +09:00
parent e6fcf7c4bb
commit 956d15add0
7 changed files with 490 additions and 79 deletions
@@ -27,7 +27,7 @@ export async function processConcurrencyKeyQueue(args: {
await concurrencyManager.acquire(key)
if (item.task.status === "cancelled") {
if (item.task.status === "cancelled" || item.task.status === "error") {
concurrencyManager.release(key)
queue.shift()
continue