Repository navigation
Let a reply that answers nothing, a later --done, and any session's to-do end go in - #6271
Merged
Merged
Conversation
…o-do end go in Four refusals second-guessed agent choices that break no guarantee. Each now goes in, and where the outcome may surprise, the command notes what it did beside the record. - A reply by message id into a thread that owes the user an answer posts (was `owed-response`, an error). It answers nothing, so the update stays owed, and an advice finding under the same code names the command that answers it. The turn-end clerk still asks no question again in such a thread (`thread.ask_again`). - `--ephemeral` progress on a reference that no longer names the owed update posts in the thread, taking nothing in hand (was `superseded-reply`). The `superseded-progress` advice carries what the log now holds the event as, such as the user having resolved the thread. An answer on such a reference is still refused, since it would mark an unread newer message answered. `progress-parent`, the append door's second check of a progress line's parent, could no longer fire and is deleted: `post_reply` is the only writer of a reply's `start`, and writes one only under the parent of an update the same reading found owed. - A CLI answer's retry key hashes the whole write (reference, words and options), not the reference alone, so `--todo` and then `--done` on one reference both go in (was `redeclared-answer`, deleted). The `--done` answer finds the update already settled by the earlier answer, whose to-do is still open, so it posts in the thread without `responds`, appends a `todo_end` (done, detail "reply <id>") and notes `todo-delivered`. An identical retry still returns the first reply; a reworded one is its own write, refused as `superseded-reply` once the update is answered. - Any agent session may end any open to-do, by `leaf task end` or a stamp's `--completes` (was `todo-execution`, deleted). The rule only made another session start the to-do first. Tests changed with the behavior: the owed-thread refusal tests in test_responses, test_interact_anchors, test_forks and the reply-guidance regtest now assert the post and its note; the race test in test_todos asserts stale progress posts without a start; reworded-retry tests now retry word for word, and a reworded answer is refused; a new test covers --todo then --done; the session-authority to-do tests become one test that a session neither opening nor starting a to-do ends it, and a stamp ends to-dos another session started. No event schema changes, so no protocol bump.
A `--done` answer to an update whose earlier `--todo` answer left a to-do open no longer appends a `todo_end` beside its reply. The two were separate appends, so a failed second append left a reply that an identical retry returns (`_repeated_reply`) and a to-do nothing would ever end. The reply still posts in the thread without `responds`, and the command now notes `promised-todo` (was `todo-delivered`): the earlier answer whose to-do is still open, and the `leaf task end` that ends it. `_Obligation.ends` and the `_promised` helper go with it. Shipped prose: threads.md now says a message posted by page and message id answers nothing, so an answer its thread owes stays owed, and that a later `--done` on a `--todo` answer's reference posts its reply while Leaf names the to-do still open. Docstrings that said a stale reference refuses every write now say it refuses an answer, with the exceptions `post_reply` names.
leaf-agent
reviewed
Nov 17, 2026
leaf-agent
left a comment
Collaborator
There was a problem hiding this comment.
The new todos.py header records the date of the decision and the rule it replaced. Root AGENTS.md, "Where instructions live", puts both in the commit message, and keeps in a header the decision itself, whether the user made it, and why the alternative fails. A rewording is inline. Nothing else in the change needs a change.
# Conflicts: # src/leaf/thread.py # tests/model/test_responses.py
leaf-agent
approved these changes
Nov 17, 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.
Three refusals that stopped a reasonable agent write now let it in and say what it did, as Max picked on the survey of refusals that second-guess agents:
owed-responsebecomes advice). A--ephemeralprogress line on a stale reference posts too, taking nothing in hand (superseded-progressadvice keeps the old refusal's news, such as a withdrawn note). A stale reference on an actual answer is still refused, so an unread newer message can't show as answered.progress-parent, the same progress case at another door, is deleted as unreachable.--todoand then--doneon one reference both go in (redeclared-answerdeleted). The--donereply posts in the thread without answering anything, and Leaf names the to-do the earlier answer opened that's still open, forleaf task end. Ending it automatically was tried and dropped: the reply and the end were two appends, and a retry after a failure between them left the to-do open for good. A reworded retry is now refused as already answered, where it used to return the first reply silently.todo-executiondeleted).Production code is −29 lines (−42 counting code alone); tests −24. Shipped prose (
threads.md,conversation-loop.md) is corrected for facts only. Independent of #6246 and #6218; no schema change.Tests: 11 focused
tests/modelfiles (788 passed) and the reply-guidance regtests. Codex reviewed the first version; its two findings are fixed in the second commit.