Description
Summary
bb tasks attach appends and there is no detach, so a task accumulates every thread ever attached to it. bb tasks threads then returns them oldest-first, which after a few respawns means the first row a reader or a script sees is usually a dead thread.
Reproduced on bb 0.38.0, macOS 26.
Observed
$ bb tasks threads SC-170
THREAD STATUS PRESET TITLE
thr_7vkzpssciq failed Attached SC-170 · OSS divergence audit (phase 1, analysis only)
thr_95z774573i failed Attached Resuming the OSS port after a machine crash killed your predecessor…
thr_uwfpuxdt7u idle Attached Resuming SC-193 after bb was updated and restarted…
thr_p9xei5xi9f idle Attached Take SC-170 — the private repo has diverged from its own upstream…
$ bb tasks threads SC-202
THREAD STATUS PRESET TITLE
thr_pue9jzpjw7 failed Attached SC-187 · transfers into a manual Scani account
thr_z5g3nw27ey idle Attached Resuming SC-202 after a machine crash killed your predecessor mid-work…
thr_bbzyu33ips idle Attached SC-202 · PaymentFormPage strings
thr_m82w2aermn failed Attached It has been a while we didn't review our current setup on production…
thr_e3qnf2u6e3 idle Attached Take SC-202 — extract v3's remaining strings behind useTranslation…
In both cases the first row is a failed thread and the one actually holding the work is last. SC-202 has grown from 4 attachments to 5 since this was first noticed, so it accumulates in normal use rather than as a one-off.
Note the first row of SC-202 is also attached to the wrong task by title (SC-187), which is the same accumulation seen from another angle: a thread respawned onto new work keeps its old attachments.
No way to undo it
$ bb tasks --help
attachment add|get|list|remove <- file attachments, not threads
attach Attach an agent thread to a task
threads List threads attached to a task
attach has no inverse. attachment remove is for file attachments and does not apply.
Why it matters
The convention this machine runs on — and which bb's own task model encourages — is that a task in progress carries an attached thread, precisely so the Active view answers who holds this work. With append-only attachments and oldest-first ordering, that view answers with a corpse, and the answer looks authoritative.
It is also self-worsening: an orchestrator that correctly re-attaches on every respawn makes the ordering worse each time.
Suggested fixes, either would help
bb tasks detach <key> --thread <id>— the missing inverse.- Order
bb tasks threadsmost-recent-first, or sort live threads abovefailed/errorones. This fixes the legibility half with no destructive operation at all, and is probably the cheaper change.
Ordering alone would be a real improvement even if detach never lands.
Activity
SawyerHood commentedon Aug 18, 2026
Reproduction & root-cause report: https://get-bb.github.io/reports/issues/1761.html
ORDER BY attached_at, id(oldest first) and the store's deleteTaskThread is dead code with no RPC/CLI/UI path, so attach is append-only and the first listed row after respawns is the dead predecessor.bb tasks detach <key> [--thread <id>]in cli/index.ts (same thread resolution as runAttach), root-help line, README/SKILL.md updates, and a Remove control on the thread card in views/detail/threads.tsx. (2) Independently, change the store query in db/store.ts listTaskThreads to sort live threads first / most-recent-first (e.g. ORDER BY CASE WHEN live_status IN ('failed','completed…The report has copy-paste repro steps, screenshots where the bug is visual, code permalinks at
16ceb3a54, and repro artifacts. It was independently re-run by a second agent (see its Verification section).Add bb tasks detach and list live task threads first (#2167)