Skip to content

Ask the go-ahead for an action the agent takes, such as a merge, as a choice the user presses - #6220

Merged
max-sixty merged 3 commits into
mainfrom
turn-end-asks-as-presses
Nov 17, 2026
Merged

max-sixty merged 3 commits into
mainfrom
turn-end-asks-as-presses

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

A ready pull request now reaches the user as a choice they press ("Merge #812" / "Hold off for now") rather than a message telling them to run /merge-pr and reply. The turn-end check's reference named "a merge waiting on the user's approval" as a step asked in words, and an agent's "Merging is yours: run /merge-pr" read to the fork as a command for the user. On 44 real pages since 2026-11-01, none of 88 merge or landing asks was a choice (72 by the fork, 16 by agents), and 17 of the 21 the user answered in words said "yes" or the merge command.

The rule now lives once, in a new paragraph of conversation-loop.md ("The On lists") that the fork reads through clerk.GUIDANCE: an action the agent takes once the user agrees is a permission, asked as options, even where the user could start it with a command they'd type to the agent; an action only the user can take is a step, asked in words. turn-end-check.md drops its copy of the step rule and adds that the fork marks an option recommended only where the agent advised it, since early runs marked "Merge" recommended unprompted.

Evidence (Claude Code fork, 3 runs per arm): the new ask-permission case, Max's closeout cut down, is asked as a choice 0/3 on main, 0/3 with only the merge example deleted, and 6/6 here. ask-step, a command only the user can run, stays in words 3/3. ask-follow-up passes 6/9 here against 7/9 on main, failing on both arms on the #6079 wording faults. closeout-asks-take-their-route now requires landings as options; both arms pass 3/3. Runs cost about $10.

To weigh: a step whose report has listable answers ("Works" / "Still broken") still asks for a reply in words; that is a separate call this PR leaves alone.

Asked for by Max in a comment on a Leaf page. Tests: tests/model/test_clerk.py, dev/tests/test_evals.py, test_product_page.py, test_interact_layer.py.

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

… choice the user presses

The turn-end check's reference told the fork to ask "a merge waiting on the user's approval" in words, asking for a reply, and an agent's closeout line such as "Merging is yours: run `/merge-pr`" read to it as a command the user runs. So a ready pull request reached the user as a message to type a reply to. On 44 real pages from 2026-11-01 to 11-16, none of 88 asks to merge or land work was a choice (72 posted by the fork, 16 by agents), and 17 of the 21 the user answered in words said "yes" or the merge command.

Who takes the action now decides how it is asked. A new paragraph in `conversation-loop.md` ("The On lists") says that an action the agent takes once the user agrees is a permission, asked as options to take it or hold off, even where the user could start it with a command they'd type to the agent; an action only the user can take is a step, asked in words with the reply rule that used to sit in the fork's reference. The fork reads that paragraph through `clerk.GUIDANCE`, and `turn-end-check.md` drops its own copy of the step rule. The fork now also marks an option recommended only where the agent advised one, since the first runs of the new case marked "Merge" recommended unprompted. The table rows, the fork's description in `conversation-loop.md` and `docs/how-it-works.html`, and `clerk.py`'s header follow.

Evals (`leaf-dev eval run 'turn-end-check/…' --harness claude-code`, 3 runs each):

- New `ask-permission`, the real closeout cut down: asked as a choice 0/3 on main, 0/3 with only the merge example deleted, 6/6 here; 2/3 of the final runs pass the wording judge, the miss a question sharing its paragraph.
- `ask-step` (a command only the user can run) stays in words, 3/3; `ask-question`, `ask-choice` and `ask-step-done` pass 3/3.
- `ask-follow-up` passes 6/9 here and 7/9 on main (counting #6202's runs), failing on both arms on the wording faults #6079 describes, mostly a reply asked for an effect the agent could check; the judge passes and fails the same sentence across runs.
- `closeout-asks-take-their-route` now requires each landing as options rather than `--obligation`; main and this branch both pass 3/3, so the agent's own route already asked this way when the case states the go-ahead plainly.
leaf-agent
leaf-agent previously approved these changes Nov 16, 2026
# Conflicts:
#	src/leaf/clerk.py
@max-sixty
max-sixty merged commit d2b0555 into main Nov 17, 2026
5 checks passed
@max-sixty
max-sixty deleted the turn-end-asks-as-presses branch November 17, 2026 05:08
max-sixty added a commit that referenced this pull request Nov 17, 2026
A step only the user can take, such as trying an install on their phone
or running a command that needs their login, now offers its outcomes as
a choice ("It installed" / "It failed") instead of asking for a typed
reply. Max asked why a normal choice couldn't ask it after #6220 made
permissions presses. Nothing in Leaf stopped it. The step rule in
`conversation-loop.md` said "ask for a reply", and
`step-on-the-user-takes-a-thread` required `--obligation` and words,
even telling the agent "there is nothing for them to choose between".

The guidance states this softly, as Max asked: "Ask for a pick" in
`threads.md` says picking an option is generally quicker and easier than
typing a reply, so a choice usually serves the user better, and the step
paragraph says options usually spare the user typing while words suit
what only they can describe, such as what an error said. Nothing says a
choice is required.

**Evidence** (Claude Code, 3 runs each):
`step-on-the-user-takes-a-thread` now requires the outcomes as options
and goes from 0/3 on main to 3/3. The fork's `ask-step` now expects a
choice and passes 3/3. `closeout-asks-take-their-route` passes 3/3, its
`/reload-plugins` step accepting options or `--obligation`. The soft
wording kept every result: `ask-permission`, `ask-step`, the step case
and the closeout case passed 12 of 12. Runs cost about $9 in all.

**To weigh:** "It failed" carries no detail, so the agent usually asks
what the user saw; the user can type the detail instead of pressing.

Requested by Max. Tests: `tests/model/test_clerk.py`,
`dev/tests/test_evals.py`, `tests/model/test_product_page.py`.

> _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