Skip to content

Ask a question again in its own thread when the turn-end check repeats it - #5833

Merged
max-sixty merged 4 commits into
mainfrom
thread-reopen-ask
Nov 12, 2026
Merged

max-sixty merged 4 commits into
mainfrom
thread-reopen-ask

Conversation

@max-sixty

@max-sixty max-sixty commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

When the agent restates a question the page already asked, such as a step the user took that didn't work, Leaf's turn-end check (src/leaf/clerk.py) now asks it again in that question's thread under its own id, as leaf thread reply --obligation <id> does, instead of opening a second thread beside it. The reply reopens the thread if the user had closed it, and On Me shows the one question in its current words.

Before this, the check could only open new threads, and it couldn't see a question whose thread the user closed without replying: such a question keeps status open with no next actor, so it was in neither the fork's On Me list nor its answered-or-withdrawn list. Now the fork sees every question On Me no longer holds, by id, and each ask can name one as again (turn-end-check.md). An ask Leaf can't put in that thread, as where the thread owes the user a reply, falls back to the old path. A new question on an old subject still opens its own thread.

The agent's side of the same failure is fixed too: the resolve handling now says only "The user resolved the thread." Its old "You owe no reply there" is what led the agent to put its follow-up in chat (browser/runtime/kernel-registry.json).

The check still skips an ask whose title matches a thread the agent opened to ask something. Replays of the real turns where that had fired found the fork re-asking, under the same title, a question the agent had withdrawn, in 4 of 4 runs; the module header records it.

Max asked for this after the check opened a second thread on the fork-roadmap page for a /reload-plugins step he had closed. Codex reviewed it twice; its findings (ask again under the question's id rather than as a new question; show the fork the question's current words) are folded in.

Tests: test_a_question_asked_again_reopens_its_thread_under_its_id. Eval turn-end-check* with --base: in the new ask-follow-up case, both head runs asked again in the closed thread (one failed the judge on its wording, asking for a reply the agent could check itself), and both base runs failed; every other case passes on both arms. A replay of the real turn end names the closed question in 3 of 3 runs.

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

…s it

The turn-end check (`src/leaf/clerk.py`) could only open new threads. On
2026-11-11 the user closed a thread asking them to run `/reload-plugins`,
having run it in the wrong session; the agent restated the step in chat,
and the check opened a second thread on the same subject instead of
continuing the first. The fork couldn't have done otherwise: it had no
way to ask a question again, and a question whose thread the user closed
without replying (status `open`, next actor none) appeared in neither
its On Me list nor its answered-or-withdrawn list. The title dedup
missed too, since the fork reworded the title.

**What the fork sees.** Each page's facts list every question asked in
words that On Me no longer holds, by its id, with its thread's title and
how it ended: answered, dropped, or closed unanswered.

**What it answers.** Each ask carries `again`: the id of the earlier
question it asks again, such as a step the user took that didn't work,
or empty (`turn-end-check.md`).

**What Leaf writes.** An ask naming a question is the agent's message in
that question's thread with `obligation: [<id>]`, as `leaf thread reply
--obligation <id>` writes one (`thread.ask_again`). The same record
stands open again on the new message, so On Me shows one question in its
current words rather than two, and the reply reopens a closed thread. An
ask Leaf can't put there, as where the thread owes the user a reply, is
taken as one naming none. A new question on an old subject still opens a
thread of its own. The agent's line says where it went and names the id
to withdraw.

Behavior change: an ask the fork names as asked again no longer opens a
new thread. `test_a_question_asked_again_reopens_its_thread_under_its_id`
covers it; the eval gains `turn-end-check/ask-follow-up`, and `ask-step`
gains a closed question on another subject as its guardrail.
leaf-agent
leaf-agent previously approved these changes Nov 11, 2026
The `resolve` handling read "The user closed the thread. You owe no
reply there; a to-do you opened on it stays open until you end it." On
2026-11-11 an agent handed that line put its follow-up to a resolved
question only in chat instead of asking again in the thread. The
handling now says "The user resolved the thread." and leaves what the
agent does next to the references: a reply reopens the thread
(`threads.md`), and a to-do stays open after the user resolves its
thread (`conversation-loop.md`, "Long-running work").
Replayed with the current question, the real turn ends where the title
check had fired (2026-11-04, a page whose agent withdrew the check's
ask as already asked on the page) found the fork asking the withdrawn
question again in a new thread under the same title in 4 of 4 runs.
`again` now carries the one case where the check had dropped a
legitimate follow-up, so the check stays.
@max-sixty
max-sixty merged commit 7c21121 into main Nov 12, 2026
7 of 8 checks passed
@max-sixty
max-sixty deleted the thread-reopen-ask branch November 12, 2026 09:31
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