opencode icon indicating copy to clipboard operation
opencode copied to clipboard

feat(session): implement background job runner with queue and lifecycle events

Open edlsh opened this issue 1 day ago • 0 comments

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

edlsh avatar Dec 23 '25 13:12 edlsh