Skip to content

Let the agent ask a question again with --obligation <id> where the user's reply left it standing - #5445

Merged
max-sixty merged 3 commits into
mainfrom
on-me-widget-owned
Nov 5, 2026
Merged

max-sixty merged 3 commits into
mainfrom
on-me-widget-owned

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

The user's next message in a thread answers a question asked in words, whatever it says. That stays, so On me clears the moment they reply and they can empty it without waiting for the agent. What changes is what follows a reply that only asked back, such as "where do I get the build?". The agent had to ask under a new id, so a plan step naming the question read done with the step still to do.

leaf thread reply --obligation now takes an optional id, and can be repeated. With no id it asks a new question under the message's own id, as before. With the ids of questions the user's reply answered, each returns to On me under the id and words it had, standing on this reply, which the user's next message answers, and a plan step naming it reads open again. A reply's obligation is true or that list of ids. One reply can't do both, and naming a question its own thread never asked is refused (unasked-obligation). thread create keeps the plain flag, since a new thread has no earlier question to name. Since the id is optional, a bare --obligation written before the answer reference takes the reference as its id, and click refuses the command for a missing argument; every documented form puts the reference first.

The delivery of the user's reply lists the questions it answered in a new settled field, with a clause saying how to ask one again and that anything more they need, even on the same subject, is a new question with no id. Only the agent can tell which applies: on real pages, its next question in a thread sometimes continues the decision and sometimes opens a new one.

The user chose this on 4 November 2026 over handing the question to the agent until it replied, as a widget's does, which kept the item on On me until the agent had read the reply. Asking again is the declaration asking is, rather than a flag of its own. obligations.py's header records both, and clerk.py's header no longer records asking again as a cost of removing to-dos on the user.

Protocol 41 to 42: a reply's obligation can now be a list, which a Leaf at 41 refuses. Delivery now reads the page's obligations for the user's words only in a thread where the agent's messages may ask, rather than whenever any message on the page does.

Testing

  • The model tests covering obligations, to-dos, delivery and the help and layer-contract snapshots pass (343), as do pnpm run check:browser and pre-commit. pnpm run test:runtime passed before the flag took ids, a change that touches no runtime code.
  • evals/reply-left-standing-reopens scores the settled clause on real deliveries: the question's id when the user asked back, --done when they answered, --obligation with no id for a new question. 9/9 on Claude Code and 9/9 on Codex. The base has no way to ask again, so it has no arm.
  • A Chromium probe showed one On me card under the question's id on the newest message, and Waiting on me only there. It ran before the last fixes, which change no field the browser reads.

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

The user's next message in a thread answers a question asked in words, whatever it
says. That stays, so On me clears the moment they reply and they can empty it without
waiting for the agent. What changes is what follows a reply that only asked back, such
as "where do I get the build?". The agent had to ask under a new id, so a plan step
naming the question read done with the step still to do.

An agent reply now names such questions with `--reopen <id>`, and each returns to On me
under the id and words it had, standing on that reply, which the user's next message
answers. A plan step naming it reads open again, under the same title. The delivery of
the user's reply lists what it answered in `settled`, with a clause saying how to reopen
one and that anything more they need, even on the same subject, is a new `--obligation`.
Only the agent can tell which applies: on real pages, its next question in a thread
sometimes continues the decision and sometimes opens a new one.

The user chose this on 4 November 2026 over handing the question to the agent until it
replied, as a widget's does, which kept the item On me until the agent had read the
reply. `obligations.py`'s header records that, and `clerk.py`'s header no longer records
asking again as a cost of removing to-dos on the user.

Protocol 41 to 42: a reply record gains `reopens`, which a Leaf at 41 would read as a new
question. Delivery reads the page's obligations for the user's words only in a thread
where the agent's messages may ask, rather than whenever any message on the page does.

evals/reply-left-standing-reopens scores the clause, on real envelopes: reopened when
they asked back, `--done` when they answered, `--obligation` for a new question, 9/9 on
Claude Code and 9/9 on Codex at this wording. Base has no `--reopen`, so it has no arm.
Asking again puts the same item back on On me as asking puts a new one there, so it is
one declaration rather than two. `leaf thread reply --obligation` with no value still
asks a new question under the message's own id, and `--obligation <id>`, repeatable,
asks the questions those ids name again. The record follows: a reply's `obligation` is
`true` or the list of ids, and `reopens` is gone, with the `unasked-reopen` finding
renamed `unasked-obligation`. A reply can't do both, since one message asks new words
or repeats questions already asked, and the CLI refuses the pair. `thread create` keeps
the plain flag, since a new thread has no earlier question to name.

The protocol stays at 42, the number this branch already took for the reopening field.

The `settled` clause now says to give `--obligation` the question's id, and
evals/reply-left-standing-reopens, regenerated from real deliveries, scores 9/9 on
Claude Code and 9/9 on Codex at this wording: the id when the user asked back, `--done`
when they answered, `--obligation` with no id for a new question.
# Conflicts:
#	src/leaf/cli.py
#	tests/model/test_obligations.py
@max-sixty
max-sixty merged commit 7607555 into main Nov 5, 2026
4 checks passed
@max-sixty
max-sixty deleted the on-me-widget-owned branch November 5, 2026 08:54
max-sixty added a commit that referenced this pull request Nov 5, 2026
`settled`, which the delivery of the user's reply gained in #5445, is a
fourth field that tells the agent what to do at the time, and `leaf page
state` doesn't report it under that name. `event_facts.py` already lists
it, and root `AGENTS.md` now does too.

> _This was written by Claude Code on behalf of max-sixty_
max-sixty added a commit that referenced this pull request Nov 10, 2026
…ecord why each message was forked, and add leaf-dev timeline (#5796)

Forks went silent on long-lived Claude Code sessions after a protocol
bump, and nothing recorded why. This adds the diagnostics and the tool
that found it, and the fix.

**The bug.** On 8 Nov the leaf-issue-triage session's pages follower had
run since 4 Nov at protocol 41. Its checkout moved past two bumps
(#5445, #5716), and the session's hooks ran the newer Leaf, which reads
a fork lane written at an older protocol as down. So the old follower
held messages and asked for forks, the fork step said "not held" and
made none, and each message waited out the 30 s hold with no working
line. One waited 64 s while the session sat in a 70 s foreground poll,
the case forks exist for.

**The fix.** The pages follower (`hooks.cmd_pages`) now exits with
`EX_TEMPFAIL` (75) once the session's hooks would run another Leaf than
its own: another installed copy, another selected checkout, its own
checkout moved past a protocol bump, or its own install removed. The
hooks module (`hooks/claude-code.ts`) starts it again on exit 75, under
that Leaf. Verified live: changing the protocol on disk and back
replaced a running session's follower each time, and the next comment
got its line at 3.1 s.

**Diagnostics.** Each page's observations now record `fork_hold` at
admission (held or not, and whether the session's fork lane was up) and
`fork_asked` when Leaf gives the module the fork's question, beside the
existing `fork_reply` outcomes. When the module's own fork step fails,
it now tells Leaf, which hands the message over at once and records the
error instead of a silent 30 s wait.

**`leaf-dev timeline PAGE [--message ID]`** merges a page's log and
diagnostics, each Claude Code session's transcript (turns, the context
Leaf's hooks carried in, `leaf` commands, subagents) and Claude Code's
debug log into one time-ordered story, with a summary line per message:
held or not and why, the fork's outcome and time, first words, pickup
and what the session was doing, answer. The Claude Code journey now
keeps the session's transcript in its evidence, so the tool reads a
journey run as it reads a live page.

`TODO.md` also gains a challenge Max asked for: streaming the agent's
reply into its thread through one general interface.

Tests: `tests/model/test_forks.py` (the diagnostics; the follower ending
for each kind of Leaf change),
`tests/process/test_interact_claude_code_module.py` (a follower that
exits 75 starts again), `dev/tests/model/test_response_times.py`. Live:
`leaf-dev journey claude-code --forks --case working`, and real pages
from 6 to 9 Nov.

> _This was written by Claude Code on behalf of max-sixty_
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