Skip to content

Leave what a thread summary shows to the agent, and keep it to a few sentences - #6617

Merged
max-sixty merged 15 commits into
mainfrom
thread-fold-summaries
Nov 20, 2026
Merged

max-sixty merged 15 commits into
mainfrom
thread-fold-summaries

Conversation

@max-sixty

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

Copy link
Copy Markdown
Owner

A thread summary now replaces the messages it folds, and Leaf's code leaves what a summary shows to the agent. Before, Leaf's served state marked folded messages that held the user's open items or the agent's owed turn as protected, and the browser forced such a summary open under "Messages kept open · current work". A reply folded with its correction, both waiting on the user, then showed the answer three times, and the agent's summary ran 65% of the two messages' length. This removes protected and the forced fold, and admission's refusal of a range that leaves an older message in full above a summary (summary-gap, from #5531), so the agent can keep an older question in full; the delivery hint still suggests a range with no gap. threads.md gives the agent the goal (the user reads a summary in place of its messages, so it is much shorter: "a few sentences, usually under sixty words") and the context (a folded ask stays On Me and opens the fold from there). The summary fork quotes the same paragraph.

Two follow-ons the removal exposed: On Me's Show focused a message hidden in a closed fold, so arrive now reveals what it focuses; and folded unread messages kept the card offering Next unread, so a fold seen whole now reads the messages it folds, whatever it says of them.

Evals, main's guidance against this branch's final code, three runs each: summary fork over long replies 0/3 → 3/3, length 0.53–0.69 → 0.15–0.17 of the range; over one-line messages 0/3 → 3/3; agent folding its correction 0/3 → 3/3, 182–212 → 59–70 words; guard cases unchanged (fork 9/9, agent 12/12).

Max asked for this on a Leaf page, and for the range and read changes in review there; Codex reviewed each round. Tests: focused model, runtime and browser tests, including new ones for On Me into a fold and reading through a fold.

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

leaf-agent
leaf-agent previously approved these changes Nov 20, 2026
Admission no longer refuses a summary that leaves a message in full above
it (`summary-gap`). That rule came from #5531: a summary folded a middle
stretch and older messages stayed in full above it. Max asked on #6617 for
summaries where the agent decides what shows, and the rule kept the agent
from keeping an older question in full between two summaries, which the
new guidance invites. The hint still suggests a range with no gap
(`thread_context._gapless`, moved from `events.summary_range`, its only
caller now), and threads.md still asks for one summary over earlier ones.
A summary that ends inside an earlier one now uncovers that one's tail
rather than being refused.

A fold seen whole now reads the messages it folds whatever it says of
them, a bare fold or a label included, since the agent folded them for the
user to read the fold instead. Before, only summary prose did.
The fork's prompt still told it Leaf takes no range that leaves a message
in full above a summary, which admission no longer refuses. A panel test
also claimed Next unread opens a fold the view had just shown, which now
reads the replies it folds; Codex found both.
leaf-agent
leaf-agent previously approved these changes Nov 20, 2026

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The description becomes main's commit message on merge, and a320c1f moved two of its claims:

  • It says a summary's prose shown whole reads the messages it folds and "a label-only fold reads nothing". Now any fold seen whole reads them, including a bare fold or one with only a label (transcript.js observes .lf-summary-checkpoint).
  • It doesn't say that admission no longer refuses a range that leaves a message in full above a summary (summary-gap is gone, along with events.summary_range). Only the hint still widens to keep that rule (thread_context._gapless). It also doesn't say that a summary ending inside an earlier one now uncovers that summary's tail instead of being refused.

Could you update the body to match?

@max-sixty max-sixty changed the title Let a thread summary replace its messages, and keep it to a few sentences Leave what a thread summary shows to the agent, and keep it to a few sentences Nov 20, 2026
leaf-agent
leaf-agent previously approved these changes Nov 20, 2026
main's #6569 dropped the panel row's On Me mark (ON_ME_MARK); the leaf opens
On Me now, which leaf_dev.browser.open_on_me drives.
leaf-agent
leaf-agent previously approved these changes Nov 20, 2026
@max-sixty
max-sixty merged commit 0764c73 into main Nov 20, 2026
6 checks passed
@max-sixty
max-sixty deleted the thread-fold-summaries branch November 20, 2026 23:09
max-sixty added a commit that referenced this pull request Nov 21, 2026
…a survey finds it (#6630)

The refusal survey of 16 November listed `findings.py`'s codes and their
hits in agent transcripts, so it missed the two summary mechanisms #6617
later removed that refused nothing: served state's `protected`, which
forced a fold open, and the rule that only a summary's prose read the
messages it folded. Neither prints a finding or leaves a trace in a
transcript. The third, `summary-gap`, it found and kept as Max's: #5531,
an issue an agent wrote in his name, described the outcome, and an
agent's sweep (#6049) made that a refusal.

This adds "Code that chooses for the agent" to root `AGENTS.md`'s
"Regular maintenance": the shapes such code takes besides a refusal,
each judged by "Leaf's role" whoever asked for it, and where the ones
that print nothing show, in what the page draws set against what the
agent's write declared. "What it buys" now credits an outcome the
maintainer asked for rather than any request.

Worth weighing: an earlier version also added a `/developing-leaf`
section walking `findings.py` and the served-state schema; Max asked for
it to come out. In fresh sessions running his 16 November request on the
tree before #6617, that walk found `protected` once in two runs, against
none in five without it, so the bullet alone may leave surveys missing
such code.

Max asked for this investigation and for the skill section's removal;
nobody else has read it. No tests cover maintainer guidance; pre-commit
passes.

> _This was written by Claude Code on behalf of max-sixty_

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
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