Repository navigation
List a page's held to-dos in each delivery, so input that ends a wait brings its to-do back - #7312
Merged
Merged
Conversation
… brings its to-do back A to-do held with `--waiting-on` read Waiting on <what> until the agent started it, and Leaf reads nothing from the words, so only the agent's memory of earlier turns brought the work back when the wait ended. `leaf page state` carried `waiting_on`, but agents run it at will: 98 of 191 Leaf sessions on this machine in the week to 26 Nov ran it at all, and about a third of the 5,300 calls projected `obligations` away with jq. Nothing Leaf pushes (deliveries, the Stop hook, the turn-end check) named a held to-do. Each delivery batch now carries `held`, the page's open to-dos that name a wait (id, text, waiting_on), whatever its input, since Leaf can't tell which input ends a wait. A clause under `$events.answering.reply` and `.markup` tells an event that owes an answer to start such a to-do, as well as the input, where the input frees it, and to end it with an outcome. DELIVERY moves to since 59, so pasted eval envelopes read `leaf-delivery/59`. Scored on Claude Code, 3 runs an arm, with the new case `held-todo-returns-with-its-input`: a Done on the choice the to-do waits on started the to-do 6/6 with this change (two wordings) and 0/3 with main's delivery and instructions, and 0/3 with this change's references but main's delivery; an unrelated question left it held 9/9 across all three. A Codex reply correction also picked the first batch from the page in its original delivery, which, when Codex took two watch passes while busy, held another input, so the correction carried no events; it now picks the batch holding the input. Maximilian asked for this after #7303 added `--waiting-on`.
… case The reference's rule for input that frees a held to-do without owing an answer named `leaf task start <page> <id>`, which refuses without `--text`. The case's rubric now also requires the start on the Done event, as the clause asks.
leaf-agent
approved these changes
Nov 26, 2026
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.
Each delivery batch now lists the page's open to-dos that name a wait (
held: id, text andwaiting_on), whatever its input, and an event that owes an answer is told to start such a to-do, as well as the input, where the input frees it. Before this, a to-do held with--waiting-on(#7303) came back only if the agent remembered it:leaf page statecarrieswaiting_on, but agents run it at will (98 of 191 Leaf sessions on this machine last week ran it at all, and about a third of its calls projectedobligationsaway), and nothing Leaf pushes named a held to-do. Max asked for a primitive so the agent needn't remember such work across a long context.To weigh: Leaf reads nothing from a wait's words, so it lists every held to-do with every batch and the agent judges which input frees one; the clause rides only events that owe an answer, and the reference states the rule for any input. DELIVERY moves to since 59, so pasted eval envelopes read
leaf-delivery/59. Also fixes a Codex reply correction that picked the first batch from the page in its delivery, which, after two watch passes while Codex was busy, held another input and so carried no events.Scored on Claude Code, 3 runs an arm, with the new case
held-todo-returns-with-its-input: a Done on the choice the to-do waits on started it 6/6 with this change (two wordings), 0/3 with main, and 0/3 with this change's references but main's delivery; a question elsewhere on the page left it held in all 12 runs.Tests: the delivery, contract, to-do, hook and Codex App Server model tests, and
pnpm run check.