Skip to content

feat: lead agents can wrap up their threads, and late work reaches them - #1021

Merged
badcuban merged 2 commits into
mainfrom
fix/subthread-wrapup-ux
Nov 20, 2026
Merged

badcuban merged 2 commits into
mainfrom
fix/subthread-wrapup-ux

Conversation

@badcuban

Copy link
Copy Markdown
Collaborator

A lead couldn't wrap up three finished child threads. A child only wrapped itself when its newest turn was the answer that went back to the lead. Work after that (a check-back, or a reviewer it invited replying and the child fixing and committing) never reached the lead, so the lead missed a commit. A child the lead stopped never counted as finished. And agents had no tool to wrap a thread.

How it's fixed:

  • Late replies reach the lead. At the parent agent's next turn, attached children that finished a turn nobody asked for after their hand-back are listed with their latest reply (lateReplyOf). After the turn is sent, the decider records each one handed back, so it wraps itself. This doesn't wake the parent, so a child that keeps checking back can't loop it. It's read from the threads at turn start, so a restart loses nothing.
  • A stopped child counts as finished. thread_stop records the turn it cut off as handed back, here and on a linked computer.
  • thread_wrap tool. A parent's agent wraps up finished threads it started. The decider enforces it (byParentAgent on thread.done-override.set, refused from clients) and marks the child seen. A child waiting on the user, or one a person wrote to since its answer went back, is refused.

Not covered: late replies from children on a linked computer, and lead turns started by the lead's own check-back (they get late replies at the next regular turn).

The Claude replay fixtures were edited by hand to add thread_wrap to the allowed tools rather than re-recorded.

Checks: fmt, lint, typecheck; server, web, shared and contracts unit suites; web browser suite; replay tests. Desktop tests didn't run (Electron install broken in the worktree).

A child thread only wrapped itself when its newest turn was the answer that
went back to its parent. Work after that (a check-back, a reply from a
reviewer it invited) never reached the parent, so the lead could miss a
commit, and the child stayed in the sidebar. A child the lead stopped never
counted as finished, and agents had no way to wrap a thread.

- Late replies: at the parent agent's next turn, attached local children
  that finished a turn nobody asked for after their hand-back are listed
  with their latest reply (lateReplyOf). Once the turn is sent,
  thread.child-notes.delivered carries lateReplies and the decider records
  each child handed back, so it wraps itself. Nothing is woken, so a child
  that keeps checking back can't loop its parent, and the facts are read
  at turn start, so a restart loses nothing.
- thread_stop records the turn it cut off as handed back
  (stoppedTurnHandedBack), and a link's stop does the same on the child's
  computer.
- thread_wrap: a parent's agent wraps up finished threads it started.
  thread.done-override.set takes byParentAgent, which the decider checks
  (agentWrapRefusal) and the Normalizer refuses from clients; the wrap
  marks the child seen. A child waiting on the user, or one a person wrote
  to since its answer went back, is refused.
- listThreadShells can filter by parent thread.
- Claude replay fixtures: thread_wrap added to the allowed tools by hand.
@vercel

vercel Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
threadlines Skipped Skipped Nov 20, 2026 6:33pm UTC

Request Review

@badcuban
badcuban added this pull request to the merge queue Nov 20, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 20, 2026
@badcuban
badcuban added this pull request to the merge queue Nov 20, 2026
Merged via the queue into main with commit 9c83051 Nov 20, 2026
23 checks passed
@badcuban
badcuban deleted the fix/subthread-wrapup-ux branch November 20, 2026 18:51

This branch was previously deployed

1 inactive deployment
Preview — d79bd34e Deployed Nov 20, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant