Repository navigation
feat: lead agents can wrap up their threads, and late work reaches them - #1021
Merged
Merged
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
badcuban
enabled auto-merge
November 20, 2026 18:30
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Nov 20, 2026
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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.thread_stoprecords the turn it cut off as handed back, here and on a linked computer.thread_wraptool. A parent's agent wraps up finished threads it started. The decider enforces it (byParentAgentonthread.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_wrapto 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).