You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE] Summarize after message 0 when the cut lands on the last message #5736
#5470 keeps message 0 verbatim and moves a recency pass's cut off the last message, so a text summary never joins the live turn. When the moved cut leaves nothing to summarize after message 0, the pass is skipped, even in cases where main summarizes without touching the last message:
In the reviewer's fuzz on #5470, this accounts for 85 of 3,000 histories that main summarizes and #5470 skips. Only configs with preserve_recent ≤ 1 (or 2 with a trailing tool pair) hit it; the built-in configs (preserve_recent=4 and 0.7) do not.
Proposed Solution
Keep the move. When the moved cut leaves nothing to summarize after message 0, plan again with the unmoved cut and add the last message to _locked_roles / lockedRoles, so the summary can stand alone or join the message before the gap but never the last message.
In the reviewer's prototype (a monkeypatch on #5470):
75 of the 85 are summarized.
0 violations, and the last message is never modified.
Alternatives ruled out on #5470: dropping the move (305 passes then modify the live last message), and always locking the last message instead of moving the cut (loses 262 passes the move allows).
Acceptance
Python and TS change together, with matching tests:
the history above summarizes message 1;
the last message is never modified;
a pass whose only possible summary would join the last message is still skipped.
Activity