Repository navigation
Description
Task dependencies
What I was trying to do
Run a thread as an orchestrator that decomposes a plan into Tasks and dispatches each piece to its own agent. Tasks already covers most of this well: presets carry provider/model/reasoning correctly, dispatch seeds the worker with project context and a report-back contract, the thread is auto-attached, and status flips to in_progress.
What I can't express is that a task must not start until other tasks have finished.
Why this needs a relation, not a convention
The obvious workaround is to have the orchestrator chain dispatches — wait for a worker to finish, then dispatch the next task. That covers a two-task handoff, and for the common "implement, then review" case Tasks arguably models it already with the in_review status. Those are not the cases I'm stuck on.
The cases where chaining doesn't work:
Fan-in. Five tasks run in parallel, each in its own worktree on its own branch. A sixth task integrates the branches. It depends on all five, and the orchestrator has no single "previous worker" to chain from — it has to know that the fifth one landing is the one that matters. Today it can only poll every attached thread and diff the set itself. This is the shape dispatch actively encourages, since worktree isolation is the default and integration is always left over at the end.
Hard preconditions. A task that consumes an artifact another task produces — the migration before the code that queries the new column, the endpoint before the client that calls it. Dispatching early doesn't produce a worse result, it produces a wasted agent run against a repo where the thing doesn't exist yet. That cost is why the constraint needs to be enforced rather than remembered.
Blockers that aren't agents. "Design sign-off" or "credentials provisioned" can block three implementation tasks. There is no thread, so there is no completion event to chain from — the only way to model it is a task whose blockers resolve when a human closes it.
Plans that outlive the thread that made them. A twenty-task plan is executed over days, across orchestrator restarts and several different threads. The ordering has to live somewhere durable and queryable. A context window is neither.
What exists today
tasks has parent_task_id, but that is containment, not sequencing — a subtask is part of its parent, not blocked by a sibling. There is no dependency relation in the schema, so the constraint ends up in a label naming convention or in an external scheduler's private storage, where it is invisible in the UI and unvalidated against the tasks it references.
Proposal
CREATE TABLE IF NOT EXISTS task_dependencies (
blocker_task_id TEXT NOT NULL REFERENCES tasks(id) ON DELETE CASCADE,
blocked_task_id TEXT NOT NULL REFERENCES tasks(id) ON DELETE CASCADE,
created_at TEXT NOT NULL,
PRIMARY KEY (blocker_task_id, blocked_task_id),
CHECK (blocker_task_id <> blocked_task_id)
);Appended as a new migration statement, not an edit to an existing one, since the statement index is the migration id.
Rules:
- Both tasks must belong to the same project.
- Cycles are rejected at write time.
- A task is ready when its status is
todoand every blocker isdoneorcanceled.
CLI surface
bb tasks update ABC-12 --blocked-by ABC-11 # repeatable
bb tasks update ABC-12 --unblock ABC-11 # repeatable
bb tasks list --ready # todo with all blockers resolved
bb tasks show ABC-12 # renders Blocked by / Blocks--json on show and list would carry blockedBy and blocks as arrays of task keys, so a scheduler can walk the graph without scraping human output.
--ready is the important one: it answers "what can start now" in a single query, which is exactly what fan-in and human-gated blockers make expensive to compute any other way.
UI
Blocked-by and blocks rows in the task detail pane, and a badge on blocked tasks in the list so it's obvious why something isn't being picked up.
Why in Tasks rather than in a plugin on top
A scheduler can keep the graph in its own storage keyed by task key — that's what I'm doing for now — but it means the dependency is invisible in the Tasks UI, unvalidated against task existence, orphaned when a task is deleted, and not shared between two tools that both want to reason about ordering. The relation constrains task data and belongs next to it.
Deliberately out of scope
No auto-dispatch on unblock. Deciding what to run when a task becomes ready is policy and belongs to whatever is orchestrating; this proposal is only about being able to state the constraint and query it.
Activity
toasterman234 commentedon Aug 7, 2026
Swag
MGrin commentedon Sep 6, 2026
Some field evidence for this, from a machine that has been running the Tasks plugin hard
since August. Measured 2026-09-06 on bb 0.41.0, one board of 3,506 tasks / 19,310
comments across 8 projects.
The relation people actually use is prose, and it outnumbers the stored one 43 to 1.
parent_task_id— the only relation the schema offers — is used 189 times of 3,503(5.4%), with 15 distinct parents, never cross-project, never deeper than two levels.
Four of the eight projects use it zero times.
Meanwhile, matching
\b(AB|SC|MX|BC|MO|HA|BX|PI)-\d+\bovertitle + descriptionwithself-references excluded:
Comments carry them too: 9,291 of 19,310 (48.1%) name a task key.
8,106 real, resolving edges the store cannot express, against 189 it can. There is no
way to ask "what references MX-200?" (36 citations) except a full-text scan of every
description.
The kinds are not all
blocks, which I think matters for the schema. Hand-reading themost-connected rows, the common relations are
blocks,caused-by(a bug and the incidentit produced — a cause/consequence pair filed as two correct rows with nothing linking
them),
supersedes(a measurement that corrected an earlier one), and plainrelates-tofor a family of rows sharing one root cause. A
(from, to, kind)table would carry allfour; a boolean blocker column would carry one.
There is also a working reference implementation in the wild:
get-bb/marketplace#133vendors thisplugin and adds
bb tasks dependency add|remove|listwithblocking.test.ts,dependencies.test.tsandcreation-blockers.test.tsbeside it. I am not suggesting thatfork — it vendors
desktop-v0.35.1— only that the CLI shape has been tried.Happy to supply the extraction script or the per-project breakdown if either is useful.
mistakeknot commentedon Oct 8, 2026
#1144 proposes
task_dependencies(blocker_task_id, blocked_task_id). One requirement worth settling in that design: the relation must be allowed across projects. Our boards are one project per repository and real blockers cross them (a task in one repository waits on a task in another), so a same-project-only relation would not replace the external tracker we use today.Also needed, beyond the table: a ready query that treats an unresolved blocker as not ready, and cycle rejection at write time (the proposed
CHECK (blocker_task_id <> blocked_task_id)only rejects self-loops).Evidence. At the pinned SHA the
CREATE TABLEstatements in schema.ts are folders, projects, tasks, labels, task_labels, comments, attachments, task_threads and presets; there is no relation table. Ruled out: sub-tasks (one level, same project, containment not sequencing).Environment. bb
0.44.0+aleph.0.5.3(fork build of upstream), Linux 6.8, tasks pluginplugins/tasks(Tasks 0.1.2). Evidence pinned to upstream53c1e870d128c792dd3a0e469077cc4e6157b40d.