Skip to content

Conversation

@edlsh
Copy link
Contributor

@edlsh edlsh commented Dec 23, 2025

Routes async session work through the SessionRunner queue (#5887).

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

Changes:

  • Task tool now uses SessionRunner.enqueue() for child sessions
  • Server routes background prompts through the runner
  • Unified job tracking and lifecycle events for all async work
  • Additional tests for task tool integration

…ation

PR1 of async subagent delegation stack (Issue sst#5887).

This commit introduces the SessionRunner namespace which provides a unified
interface for executing session loops:

- runOnce(): Synchronous execution wrapping SessionPrompt.prompt (implemented)
- runBackground(): Fire-and-forget execution for async delegation (scaffold only)
- Options/RunResult types for future background execution
- State tracking infrastructure for active background runs

No behavior change - this is purely an abstraction layer.

Next: PR2 will implement runBackground() with lifecycle events.
…le events

- Add Job, JobKind, JobStatus, EnqueueOptions schemas
- Add enqueue(), cancel(), get(), list() APIs
- Add lifecycle events (Queued, Started, Completed, Failed, Canceled, TimedOut)
- Add configurable timeout and concurrency via experimental.backgroundTasks
- Fix: queue now restarts after idle (removed stale started flag)
- Fix: dedupe now returns completion promise, not immediate job reference
- Fix circular import by using regular function for runOnce
@edlsh edlsh force-pushed the feat/async-subagent-3-centralize branch from 1c71444 to 020cf5c Compare December 24, 2025 03:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant