# Autonomous Task Queue (https://jackin.tailrocks.com/roadmap/autonomous-task-queue/)



**Status**: Open — no code exists yet; jackin❯ has reusable launch/isolation/status/telemetry primitives but no queue, task source, or dispatcher (Phase 4, [Agent Orchestration Program](/reference/research/agent-orchestration/program-research/))

## Shipped baseline [#shipped-baseline]

jackin❯ has the primitives an autonomous queue would reuse, but not the queue itself. Manual `jackin load` already creates isolated role instances through the runtime launch pipeline, claims DNS-safe container names with an 8-character random instance id, writes instance manifests, prepares workspace mounts, launches the capsule, attaches the foreground session, and finalizes isolated worktrees on exit. Worktree isolation is per container: <RepoFile path="crates/jackin-isolation/src/materialize.rs">crates/jackin-isolation/src/materialize.rs</RepoFile> materializes host worktrees under the per-container state tree, and <RepoFile path="crates/jackin-isolation/src/branch.rs">crates/jackin-isolation/src/branch.rs</RepoFile> derives `jackin/scratch/<selector>` branch names today. Agent runtime status is also partly shipped: Capsule owns the status state machine, publishes `AgentStatusReport` over the protocol, and combines screen rules, OSC markers, foreground process evidence, and cooperative reports. Usage telemetry has a landed Capsule slice: account quota snapshots persist in a Capsule-local Turso `account_usage_snapshots` table, and token-spend monitoring is described as shipped in the Token & Cost Telemetry research page, but the host-global per-instance `usage_samples` substrate remains open.

No source-backed task queue exists in code. The operator config has `workspaces`, role sources, auth, runtime, docker, git, and dirty-exit policy fields, but no top-level `task_sources`, no workspace `task_sources`, and no `[workspaces.<name>.queue]` schema. The CLI has `load`, `console`, `status`, `usage`, workspace/config/role management, and other operational commands, but no `jackin queue` command. Repository search found no queue dispatcher, `TaskSource` trait, task table, PR lifecycle table, queue scheduler, budget gate, or queue console panel. Treat this page as planned work only, with the shipped baseline above as reusable substrate.

## Remaining work [#remaining-work]

1. Per-workspace queue config and source assignment (`task_sources`, `[workspaces.<name>.queue]`).
2. Durable task table and idempotent source polling integration, once the [Task source abstraction](/roadmap/task-source-abstraction/) and [Persistent storage layer](/reference/research/agent-orchestration/memory/persistent-storage-layer/) land.
3. Dispatch loop tied to console/runtime lifecycle, with pause/resume state; per-task instance launch reusing the existing load and isolation primitives.
4. First-prompt templating through task-source handlers, keeping user-controlled task body clearly separated from role instructions (prompt-injection surface).
5. Completion classification from runtime status, exit/finalization, and outcome markers (`completed`, `failed`, `needs_review`).
6. PR lifecycle metadata and manual gates for publish, ready-for-review, request-review, merge, and auto-merge.
7. CLI commands: `jackin queue list|feed|retry|cancel|pause|resume|approve`. None exist today.
8. Console queue panel with pending, in-flight, failed, completed, and gate-wait states.
9. Budget gating (`budget_usd_per_day`), blocked on the host-global per-instance usage-storage substrate — see [Token & Cost Telemetry](/reference/research/agent-telemetry/token-cost-telemetry/).

Full design rationale, config sketch, prior-art comparison (multicode), and open questions live in [Autonomous Task Queue: Design Exploration](/reference/research/agent-orchestration/fleet-operations/autonomous-task-queue-design/).

## Out of scope [#out-of-scope]

* Multi-workspace or organization-wide scheduling.
* Automatic retry policies, exponential backoff, and jitter.
* Cross-task dependencies.
* Webhook-driven dispatch.
* Rich reviewer assignment, team routing, and policy-driven auto-merge.
* Background daemon mode independent of console/runtime supervision.

## Related work [#related-work]

* [Autonomous Task Queue: Design Exploration](/reference/research/agent-orchestration/fleet-operations/autonomous-task-queue-design/) — problem framing, multicode comparison, recommended shape, open questions.
* [Agent Orchestration Program](/reference/research/agent-orchestration/program-research/)
* [Task source abstraction](/roadmap/task-source-abstraction/)
* [Persistent storage layer](/reference/research/agent-orchestration/memory/persistent-storage-layer/)
* [Agent runtime status](/roadmap/agent-runtime-status/)
* [Token & Cost Telemetry](/reference/research/agent-telemetry/token-cost-telemetry/)
* [Per-mount isolation](/guides/workspaces/#per-mount-isolation)
* [Idle runtime cleanup](/roadmap/idle-runtime-cleanup/)

## Related files [#related-files]

* <RepoFile path="crates/jackin/src/cli.rs">crates/jackin/src/cli.rs</RepoFile> — current top-level CLI enum; would need `Queue` commands.
* <RepoFile path="crates/jackin-config/src/app_config.rs">crates/jackin-config/src/app\_config.rs</RepoFile> and <RepoFile path="crates/jackin-config/src/schema.rs">crates/jackin-config/src/schema.rs</RepoFile> — current config schema; would need task sources and queue blocks.
* <RepoFile path="crates/jackin-runtime/src/runtime/launch.rs">crates/jackin-runtime/src/runtime/launch.rs</RepoFile> — existing manual launch pipeline to reuse programmatically.
* <RepoFile path="crates/jackin-instance/src/naming.rs">crates/jackin-instance/src/naming.rs</RepoFile> — current short DNS-safe container naming.
* <RepoFile path="crates/jackin-isolation/src/materialize.rs">crates/jackin-isolation/src/materialize.rs</RepoFile> and <RepoFile path="crates/jackin-isolation/src/branch.rs">crates/jackin-isolation/src/branch.rs</RepoFile> — existing per-container worktree materialization and scratch branch naming.
* <RepoFile path="crates/jackin-agent-status/src/lib.rs">crates/jackin-agent-status/src/lib.rs</RepoFile> and <RepoFile path="crates/jackin-protocol/src/agent_status.rs">crates/jackin-protocol/src/agent\_status.rs</RepoFile> — shipped runtime-status signal to consume.
* <RepoFile path="crates/jackin-usage/src/telemetry_store.rs">crates/jackin-usage/src/telemetry\_store.rs</RepoFile> — shipped Capsule-local account quota store; not enough for queue budget gates.
