Skip to content

Questions with a few listable answers should be choices the user can press, from the thread and from On me #5404

Closed

Description

@max-sixty

Outcome

A question with a short, fixed set of answers, such as "open the pull request now, or hold it?", should be a choice the user presses wherever it is asked. Then the page shows which way each question went, and 1–9 answer it wherever the user meets it. threads.md ("Ask for a pick") already tells the agent to ask such a question with an lf-options choose group in the message's --markup. Two routes fall short of that today.

1. The turn-end check asks in words

When an agent's reply leaves the user such a question without putting it On me, the turn-end check opens a new thread whose opening message asks it with --obligation, and the user answers by replying. Compared with a choice, that loses:

  • The state at a glance. A pick shows in the group as the checked option. A question asked in words is answered by the user's next message in its thread, whatever it says, or by a 👍. A clarifying reply such as "before I decide, how does the schedule change?" ends it: On me moves it to Done as "Answered: before I decide, how does the schedule change?" while the decision is still open, and the agent has to ask again. A reply in words leaves a choice's question open: it passes to the agent until the agent answers, then waits on the user again.
  • Keyboard answers. m lands on a choice in a thread message and 1–9 pick its options. A question asked in words takes only a typed reply (c) or a 👍 reaction (e).

clerk.py writes what the agent would write without a widget, because "the fork can't author the page". Its ANSWER schema gives each ask only page, title, text, passage and quote, and _put opens the thread with obligation=True. Its docstring already names the cost above: "a clarifying reply such as "where do I run it?" answers it, and the agent has to ask again."

One way to get there: let an ask in the fork's answer carry an optional list of options, each with a title saying what choosing it does, whether it is recommended, and optionally a line on what it costs. Where the list is present, Leaf builds the lf-options choose group itself and passes it as the opening message's markup in place of obligation=True, so the fork still authors no markup. open_thread already takes markup and refuses obligation beside a widget that asks. _ask skips an ask whose title matches a thread opened with obligation, so it would also need to count threads opened with a choice. turn-end-check.md would ask for options wherever the answers can be listed, as "Ask for a pick" does for the agent, and keep asking in words for a step the user takes, such as "run this and reply with what you saw".

2. On me can't answer a choice that stands in a thread message

On me's card for a page choice shows its options and takes 1–9. For a choice posted in a thread message, while that thread isn't drawn on the page, the card shows only Discuss and Show, and 1 does nothing. Once the user picks inside the thread, the Done row reads a bare "Answered" rather than "Answered: " until the thread is drawn again. In obligations/view.js, choicesOf returns null "while the obligation's source has no node, as in a thread turn not yet drawn". answerWords in obligations/answer.js needs the element to format the pick.

So a choice asked in a thread is answerable by key only after the user opens the thread or reaches it with m, and On me can't say which way it went. Once the turn-end check asks with choices, most of its asks would be in this case. For a question asked in words, On me's card already draws the message that asks it. Drawing the message that holds a thread's choice the same way may be one route to giving that card its options, their digits, and the pick's title.

Smaller: point to the choice where agents reach for --obligation

leaf thread create --help says "Use --obligation when the next move is the user's" and doesn't mention a widget in --markup. leaf thread reply --help names "a widget in --markup that asks" as the alternative, but not when to use it. A clause on each saying that a question whose answers can be listed takes a choice in --markup would put that route in front of the agent at the point it reaches for --obligation.

Repro

Turn-end check:

  1. In a Claude Code session holding a page, have the agent end a turn with a reply that asks the user a yes-or-no question in chat and puts nothing On me.
  2. The turn-end check opens a thread with --obligation whose message asks the question in words, with no options to press.
  3. Reply in that thread with a clarifying question. On me moves the item to Done as "Answered: ".

On me and a thread's choice:

  1. leaf thread create <page> --text "Ship on Friday?" --markup '<lf-options id="ship" choose><lf-option id="ship-friday"><strong>Ship Friday</strong></lf-option><lf-option id="ship-wait"><strong>Wait a week</strong></lf-option></lf-options>'
  2. Open the page with no thread open, and open On me. The card shows Discuss and Show and no options, and pressing 1 with the card focused changes nothing.
  3. Open the thread, pick "Ship Friday", close the thread, and look at On me's Done. The row reads "Answered".

Seen on leaf 0acede6, installed 2026-11-04T18:21:10-08:00.

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

Activity

  1. added
    enhancement
    on Nov 5, 2026
  2. leaf-agent commented on Nov 5, 2026

    @leaf-agent
    Collaborator

    #5407 adds the smaller part: leaf thread create --help and leaf thread reply --help now say that a question whose answers can be listed takes an lf-options choice in --markup. CI is running on it. It doesn't close this issue.

    On ordering the two larger parts: On me answering a thread's choice should come before the turn-end check asking with options. The issue already notes that most of the check's asks would be thread choices. Landed first, the clerk change would turn questions that On me can at least answer by reply into ones it can't answer at all until the thread is drawn. Where each part slots in:

    • On me (part 2). choicesOf in obligations/view.js returns null because there are no source controls. The card at floating-panel.js then falls back to Discuss and Show. For a reply asked in words, that same card already draws the message that asks it (carried and message, with its rank in thread/messages.js authoredRank). Drawing a widget obligation's message the same way would give choicesOf a node. It would also give lf-options.answerWords the group it needs for "Answered: ".
    • Turn-end check (part 1). This needs an optional options list on each ask in ANSWER. _put would then build the lf-options choose markup in place of obligation=True, and _ask's dedupe at clerk.py would also count threads opened with a widget that asks. turn-end-check.md and answer_form would change with it. That's a prompt change, so it should be scored with leaf-dev eval 'turn-end-check*' --harness claude-code --base before and after. This CI sandbox can't run that eval.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions