Skip to content

Read a Claude Code turn as working while busy, and start the to-do an agent waits on - #6334

Merged
max-sixty merged 4 commits into
mainfrom
claude-awaits-with-todos
Nov 18, 2026
Merged

max-sixty merged 4 commits into
mainfrom
claude-awaits-with-todos

Conversation

@max-sixty

@max-sixty max-sixty commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

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 busy while a turn runs. The fold already took that word after a turn closed, for background work; Turn.background becomes Turn.busy and 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.running is 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.md told it a --todo reply'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 new waits-in-turn variant of todo-outlasts-the-turn reproduces 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:

  • Busy is session-wide. Every page a session holds reads Working while its turn runs, as Codex's streamed steps already make them. So the tool-boundary reminder to write a status line now fires only on a page where the agent owes an update (hook_transport.status_reminders): an open to-do on another page may be one the agent left for later.
  • Pi, and Codex without App Server, publish no such word and still read a running turn as 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 listening on main, and the new hooks test fails on main's reminder.

This was written by Claude Code on behalf of max-sixty

… 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 leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/leaf/hook_transport.py Resolved
…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
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.
@max-sixty max-sixty changed the title Read a Claude Code turn as working while Claude Code says the session is busy Read a Claude Code turn as working while busy, and start the to-do an agent waits on Nov 18, 2026
@max-sixty
max-sixty merged commit 881a560 into main Nov 18, 2026
5 checks passed
@max-sixty
max-sixty deleted the claude-awaits-with-todos branch November 18, 2026 03:02
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants