Repository navigation
Read a Claude Code turn as working while busy, and start the to-do an agent waits on - #6334
Merged
Merged
Conversation
… is busy
A page's status read "Claude awaits" while its Claude Code turn ran, whenever the agent had nothing started: the user saw it with four promised to-dos on Claude and the agent's subagent working on them. The activity fold read a running turn as working only through a start, a delivery still owed in the turn, or a streamed step, and Claude Code streams no steps; its hook watch holds the wait lease through the turn, so the page fell through to `listening`.
Claude Code's session record says `busy` while a turn runs. The fold already took that word after a turn closed, as background work; `Turn.background` becomes `Turn.busy`, which also holds in an open turn, so the page reads Working, in Leaf's word until the agent starts an item, and keeps doing so past the 15-minute grace on the stamps. `Turn.running` and its grace are unchanged, so delivery handling, nudges and obligation conditions don't move. Pi and Codex without App Server still have no such word and read a running turn as listening.
Since busy reaches every page the session holds, the tool-boundary reminder to write a status line now fires only on a page holding an owed update or an open to-do, and names to-dos as items to start.
Tests: model tests for activity, hooks, workflows, Codex App Server, stop guard, wait, to-dos, claims and forks; a new activity test fails on main ("listening") and a new hooks test fails without the reminder gate.
leaf-agent
reviewed
Nov 18, 2026
leaf-agent
left a comment
Collaborator
There was a problem hiding this comment.
One finding, inline: the new reminder gate covers every open to-do. A Claude Code session that holds a second page with a to-do it isn't working on gets told, every STATUS_RENEWAL for the whole turn, that it is working on that page and to leaf task start there. Before this change that page read listening and stayed quiet.
…wes an update A busy Claude Code turn makes every page its session holds read Working, and an open to-do on one of them may be one the agent left for later while it works on another. The reminder now fires only on a page with an owed update, as before for Claude Code, so it never asks the agent to start a to-do it isn't working on. From the PR's automated review.
leaf-agent
previously approved these changes
Nov 18, 2026
conversation-loop.md said a `--todo` reply's to-do keeps the thread "on your list and in the panel's status". The status carries the agent's words only for an item it has started, so an agent that believed the sentence left the status without its line. The sentence now says the to-do keeps the thread on the agent's list, and a new paragraph says to start the to-do under the reply's id while its work runs in the turn. The session behind max-sixty's "Claude awaits" report (00e0c1c4) opened four to-dos with `--todo` replies, handed the work to a background subagent, and polled for its commit in the turn for 30 minutes without a start; it repeated the miss on a later to-do, which the turn-end check caught. Neither backstop fires inside a long turn. `todo-outlasts-the-turn` gains a `waits-in-turn` variant of that shape. On Claude Code, the miss itself (a `--todo` reply with no start before the first poll) came in 2 of 15 base runs and 0 of 15 head runs; head opened and started the to-do in 14 of 15, where base more often kept the comment in hand with an ephemeral line, which the rubric also passes. The case's main prompt passed 5/5 on both arms.
leaf-agent
approved these changes
Nov 18, 2026
max-sixty
added a commit
that referenced
this pull request
Nov 20, 2026
…arts it (#6538) A to-do an agent promised in a thread now shows what is running on it. Progress posted on the reference whose answer opened a still-open to-do, or on the to-do's own message, starts that to-do, so the line shows under the reply, in On Claude and in the panel; before, Leaf posted it and noted that it "takes nothing in hand". `conversation-loop.md` stops telling the agent to keep one start for "the one that best describes what is running", asks it to post progress on the same reference after a `--todo` answer, and to give a worker the page and the reference so it posts each step there. A promise's head reads **On it** while its to-do runs, the word every other surface gives it, rather than **Still to do** throughout. Why: on fork-messages a `--todo` reply sat at Still to do for 35 minutes while a subagent did the work. On this machine's real pages, 31 of 147 such to-dos ever got a start; 7 of 30 since #6334. In all three `main` runs of the new `moves-on` eval variant, the brief kept the worker off the page; the branch passes 3/3 (main 0/3). The other variants pass 3/3 on both arms. Not covered: a resumed working fork's progress on an old reference is refused by fork holding (`leaf task start` on the to-do works), and a start still lapses after 15 minutes of one long worker step. Requested by Max on a Leaf page; two visible follow-ups (lines on On Claude rows, a link from the thread to the row) wait on his pick there. Tests: `test_todos`, `test_responses`, the answer-head browser test, `pnpm run test:runtime`, `check:framework`. > _This was written by Claude Code on behalf of max-sixty_
max-sixty
added a commit
that referenced
this pull request
Nov 21, 2026
567 commits on main, 50 conflicted files. What the merge decided where the two sides met: - main ends a question the agent asked by any resolve of its thread (#6106, `closings`) and deleted the agent's question end. The branch keeps its own rule beside it, that the user's resolve settles nothing the agent owes (`answered_by`, `owed_turns`): one ends what the user owes, the other what the agent owes. `obligations` loses `end_question`, `ended_as` and the answered-elsewhere ending; a question a resolve ended stands `waiting` with no next actor, and a plan step naming it reads done. - main deleted Leaf's working fork and `holding.py` (#6574). `activity` drops the fork holder, agent turns and `agent_holds`; the line fork's On it (`served_state.work.lined`) reaches the fold as `on_it`, so a waiting update a progress message came after reads `running`. - main's `start_holds` (#6593) replaces the branch's turn-only start rule in `_start_age`, `in_hand` and the Stop hook, and `Turn.busy` (#6334) replaces `Turn.background`. - The neighbor row moved to `LivePage` in the schema and keeps the branch's fields; its record format moves to 53, the current protocol. - `threadRecord` (main's kept reading) takes the branch's obligation-record attention and to-dos as obligations. - Tests take main's fixtures (`lf-group`, `selected`, thread markup in the message text) with the branch's fields. Scenario S12 ends its question by resolving the thread, and the liveness scenario no longer re-dates the harness's `busy` after a start, which `start_holds` reads.
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 page's status read "Claude awaits" while its Claude Code turn was running, whenever the agent had nothing started. Max saw it with four promised to-dos on Claude while the agent's subagent worked on them. The activity fold counted a running turn as work only through a start, a delivery still owed in the turn, or a streamed step. Claude Code streams no steps, and its hook watch holds the wait lease through the turn, so the page fell through to
listening.Claude Code's session record says
busywhile a turn runs. The fold already took that word after a turn closed, for background work;Turn.backgroundbecomesTurn.busyand now also holds while the turn is open. The page reads Working, in Leaf's word until the agent starts an item, including past the 15-minute grace on the turn stamps.Turn.runningis unchanged, so delivery handling, nudges and obligation conditions stay as they were.The agent in that session had started none of the four to-dos, because
conversation-loop.mdtold it a--todoreply's to-do keeps the thread "in the panel's status". The status carries the agent's words only for an item it has started, so the reference now says so, and says to start the to-do under the reply's id while its work runs in the turn. A newwaits-in-turnvariant oftodo-outlasts-the-turnreproduces the session: on Claude Code the miss came in 2 of 15 base runs and 0 of 15 head runs, and the case's main prompt passed 5/5 on both arms.To weigh:
hook_transport.status_reminders): an open to-do on another page may be one the agent left for later.listening.Requested by max-sixty through
/diagnose-session. A Codex review and the automated review found the reminder firing on pages the agent isn't working on, and an overstatement in the docs prose; both are fixed here.Tests: activity, hooks, workflows, Codex App Server, stop guard, wait, to-dos, claims and forks model tests. The new activity test reads
listeningon main, and the new hooks test fails on main's reminder.