What happened
Child threads made by delegate_task (thread:delegated-task:…) and provider subagent threads (thread:subagent:…) stay unsettled after their task finishes and the parent has the result. They settle only when their parent settles.
A long-lived parent, such as a pinned coordinator thread, never settles. So its children never settle either. On one machine about 2,000 finished children stayed unsettled.
This also blocks worktree cleanup. A delegate_task child with isolation: "worktree" keeps its worktree on an unsettled thread, so cleanup that waits until every thread on a worktree is settled never frees it. We ran out of worktree resources and had to settle 279 children by hand.
Request: settle a delegated or subagent child automatically once its run has ended and the parent has its result (for example, when the parent reads the final result or task_status reports it done). A later message to the child unsettles it, as for top-level threads.
Diagnosis
Local children settle only through their parent:
- The settlement candidate query (
getSettlementCandidates in the projection store) returns a relationshipToParent: "subagent" thread only when its parent is settled, archived, deleted or missing.
ThreadSettlementService then auto-settles that child ("settles with the parent").
isAutoSettlementCandidate excludes pinned threads, and pinning has no expiry. So a pinned parent never settles, and its children wait forever.
- Nested delegation has the same problem one level down: a grandchild waits for its child parent, which waits for the pinned root.
- There is no setting for this.
sidebarAutoSettleAfterDays and sidebarAutoSettleOnMerge do not apply to subagent children, because the sweep handles them before it reads settings.
Checked on current main: same behaviour. #42210 added settle-when-done only for tasks delegated from a linked environment (no local parent). Local children still wait for the parent.
Steps to reproduce
- Pin a thread (or keep it active).
- In that thread, start several children with
delegate_task, some with isolation: "worktree". Native provider subagents also work.
- Let every child finish. Let the parent read each result (
task_status reports done).
- Wait for several settlement sweeps (they run every minute).
- Call
t3_thread_list with settled: false. All children are still unsettled, and their worktrees are still attached to unsettled threads.
Version
Server 0.1.13-nightly.20261125.5258. Behaviour confirmed in source at 0.1.11-nightly.20261119.4928 and on current main.
Environment
Linux, background service (serviceManaged: true). Heavy delegate_task use from a few long-lived pinned coordinator threads.
Evidence
Read-only query of orchestration_v2_projection_threads (not deleted, not archived, relationshipToParent = 'subagent'):
|
count |
| Unsettled children |
2,500 (196 parents) |
…thread:delegated-task:* |
1,965 |
…thread:subagent:* |
504 |
…latest run completed |
1,933 |
| …under one of 8 pinned root threads |
2,218 |
| …of those, with their own worktree |
1,861 |
| …whose direct parent is itself an unsettled child |
649 |
| Unsettled children whose parent is settled |
0 |
The last row shows that settle-with-parent works. The gap is only parents that never settle.
Related issues
Fix applied or workaround
Settled 279 children by hand to free worktrees. No setting covers this.
Filed by
Claude Opus 5.5 (claude-opus-5-5) in Claude Code, running inside T3 Code, following the triage playbook.