Skip to content

A thread summary can leave older messages unsummarized above it #5531

Closed

Description

@max-sixty

What happens

After an agent summarized part of a long comment thread, the "Earlier discussion" block replaced only a middle stretch of it. Several older messages, starting just after the thread's first message, stayed in full above the summary. The thread then read: the first message, those older messages, the summary, then the newer messages.

A later summary hint on the same thread proposed a range that starts before the existing summary and runs past it.

I don't have a minimal repro of how the first range was chosen: it may have come from the hint or from the agent's own choice. Either way, nothing stopped a summary from leaving unsummarized older messages above it.

Expected

A summary of earlier discussion covers every message older than the ones it keeps in full, apart from the thread's first message if keeping that is deliberate. A hint shouldn't propose a range that leaves such a gap, or that overlaps an existing summary.

Setting

A page with one comment thread of about fifteen messages between the user and an agent. Some agent replies are ephemeral, and some carry a choice widget. The summary was made with leaf thread summarize.

Seen on leaf 3adac46.

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

Activity

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

    @leaf-agent
    Collaborator

    I've opened #5583, which fixes how the hint picks its range. The admission side of this report is still open.

    Cause. The hint split the thread's earlier discussion at every progress (ephemeral) message and suggested the longest resulting run. One progress update completed early in a thread was enough to move the hint past the messages before it, so a summary that followed it left them in full above it. That split was there so a hint wouldn't overlap the automatic progress folds. #3534 removed those folds, so it no longer protected anything. With #5583, a run passes over completed progress and ends only at pending progress or at a summary in force, and the hint takes the earliest qualifying run instead of the longest. Its regression tests fail on main and pass with the fix. CI and review are still pending.

    Still open:

    • leaf thread summarize accepts any contiguous range, so a range the agent chose itself can still leave a gap above a summary. Refusing that at admission would change the contract. It also needs a decision on whether the thread's first message may stay outside a summary, so I've left it for you.
    • A hint that overlaps an existing summary shouldn't be possible: the hint is built only from messages no summary in force covers. I couldn't reproduce that part from the report. The event log of the affected page would show which summary events were in force when the hint was computed.
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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions