[PR #6036] feat(session): implement background job runner with queue and lifecycle events #11706

Closed
opened 2026-02-16 18:16:38 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/6036

State: closed
Merged: No


Implements the background job queue for async subagent delegation (#5887).

Stacked on #5996 — review/merge that first, then rebase this PR.

Changes:

  • enqueue() with FIFO queue, deduplication, concurrency limit (default 2)
  • Lifecycle events: session.background.{queued,started,completed,failed,canceled,timed_out}
  • Timeout enforcement via Promise.race + AbortController
  • cancel(), get(), list() helpers
  • Memory pruning (max 100 completed jobs)
  • Proper cleanup on Instance dispose
  • Config: experimental.backgroundTasks.{timeoutMs,maxConcurrent}
  • 25 integration tests
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/6036 **State:** closed **Merged:** No --- Implements the background job queue for async subagent delegation (#5887). **Stacked on #5996** — review/merge that first, then rebase this PR. Changes: - `enqueue()` with FIFO queue, deduplication, concurrency limit (default 2) - Lifecycle events: `session.background.{queued,started,completed,failed,canceled,timed_out}` - Timeout enforcement via `Promise.race` + AbortController - `cancel()`, `get()`, `list()` helpers - Memory pruning (max 100 completed jobs) - Proper cleanup on Instance dispose - Config: `experimental.backgroundTasks.{timeoutMs,maxConcurrent}` - 25 integration tests
yindo added the pull-request label 2026-02-16 18:16:38 -05:00
yindo closed this issue 2026-02-16 18:16:38 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#11706