Repository navigation
Hide ephemeral messages when their answer arrives - #3534
Merged
Merged
Conversation
Replace automatic progress summaries with the server's completion relation on message descriptors. Hide completed progress when its answer is presented, including provisional replies and progress covered by an explicit summary. Keep raw messages for held readings, and preserve completion metadata while a failed stream is retained. Outstanding work still has its working status. Remove completed-progress disclosure coverage and retain pending-progress and summary interactions. The shift watcher now compares rendered children, so removing a boxless checkpoint does not invalidate legitimate tail replacement; the undeclared-movement control still fails as intended. Accept the removal of optional Thread.summaries[].trigger at protocol 16. Checked transcript.js and held-news.js and trigger-reader history since be98116: only derived progress summaries supplied this field, and those entries no longer exist. Explicit summaries already omit it, and their existing readers handle that absence. No event or command contract changes. Validation: 24 focused browser cases, 26 model tests, pnpm check (including 512 runtime tests and 85 Worker tests), pre-commit, live preview journey, and matched desktop/dark/phone visual checks. Startup comparison keeps 40 requests through first presentation and loads 592 fewer code bytes.
leaf-agent
previously approved these changes
Oct 22, 2026
Remove its assertion about automatic progress summaries, which no longer exist. Model fold and browser tests cover completion visibility; this test retains its checks that progress starts work without discharging the owed answer.
leaf-agent
approved these changes
Oct 22, 2026
max-sixty
added a commit
that referenced
this pull request
Oct 22, 2026
A thread summary now folds the messages it covers by hiding them where they stand, instead of moving them into a container inside its checkpoint. **Why.** Moving a node unloads an iframe in an engine without `moveBefore`: WebKit reloaded a frame in a covered message once as the summary arrived and twice as it was retracted. A selection inside the moved messages was lost in every engine. **How.** - In `thread/transcript.js`, the checkpoint stands directly before its covered messages. They stay the transcript's own children and are hidden while the fold is closed. - `aria-owns` on the checkpoint groups them under it for assistive technology. In Chromium the covered messages are absent from the accessibility tree when the fold is closed and under the checkpoint when it is open. - The outline around an open fold spans siblings, so it is drawn with anchor positioning from the checkpoint's head to the last covered message's foot. The transcript becomes the positioning parent. - `reply-landing.js` and `thread-preview.js` skip hidden messages. **Evidence.** - New test `test_a_summary_folds_its_messages_where_they_stand`, run in Chromium and WebKit, puts a frame in one covered message and a selection in another. The frame never loads again through arrival, close, open and retraction, and the selection survives arrival. On the old runtime it fails in both engines. - Every message box and the outline measured identical to before in Chromium, Firefox and WebKit, for the panel's and the margin card's summaries, open and closed. - Side effect: in Firefox, a margin card's message controls had sat about 150px off after scrolling, and now land where Chromium puts them. - `pnpm run test:runtime` passes (522 tests), as do `test_summaries.py` and `test_agent_replies.py`, after merging #3534. TODO.md loses the item this closes. It gains two: - the other places that still move live content (resolved threads into "Resolved · N", `lf-diff` comment threads on redraw, a modal into its opener's popover, a reply's widgets between views); - a summary's Show/Hide button ignoring a press while words are selected, which predates this change. > _This was written by Claude Code on behalf of max-sixty_ --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
This was referenced Nov 6, 2026
leaf-agent
added a commit
that referenced
this pull request
Nov 6, 2026
…gress (#5583) The thread summary hint could suggest a range in the middle of a thread, so a summary that followed it left older messages in full above it. `batch_threads` split the earlier discussion at every progress (ephemeral) message and suggested the longest resulting run. One progress update completed early in a thread was enough to cut off the opening messages. That split dates from the automatic progress folds, which a hint must not overlap. #3534 removed those folds, and the browser now omits completed progress altogether, so the split no longer protects anything. A run of messages now passes over completed progress. It still ends at pending progress, which is drawn and not yet answered, and at summaries in force. The hint takes the **earliest** run that qualifies instead of the longest, so it doesn't skip past an older qualifying run. Tests in `tests/model/test_thread_reading.py`: - `test_summary_hint_leaves_no_older_discussion_above_it` reproduces the report: one completed progress update after the second message used to move the hint past the opening messages. It fails on `main` and passes here. - `test_summary_hint_takes_the_earliest_qualifying_run` fails on `main` and passes here. - `test_summary_hint_folds_completed_progress_and_stops_at_pending` replaces `test_summary_hint_does_not_cross_ephemeral_updates`, which asserted that no hint crossed completed progress. That is the behavior this PR changes. The thread-reading and interact-product model tests pass locally (61). **What this leaves open.** Two parts of the report remain: - `leaf thread summarize` still accepts any contiguous range. A range the agent picks itself can leave a gap above the summary. Refusing such ranges at admission is a contract decision, partly because the issue leaves open whether the thread's first message is kept on purpose, so it isn't made here. - The issue also saw a hint that overlapped an existing summary. In this code a hint is built only from messages no summary in force covers, and I couldn't reproduce an overlap from the report. Refs #5531 — automated triage Co-authored-by: leaf-agent <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Nov 15, 2026
…mmary A summary replaces those it overlaps whole, so one that ended inside an earlier summary uncovered that summary's tail, which then stood in full above a later summary. With S1 over m1–m5 and S2 over m6–m10, summarizing m1–m3 was admitted and the thread read: opener, summary, m4, m5, S2. Refusing m2–m3 suggested m1–m3, which led to the same gap. `events.summary_gap` now returns every message the summaries in force leave in full above the last of them, rather than above one summary's start, so admission checks the whole thread as it will read once the new summary stands. Its refusal names the requested range widened over every message it would leave, and says the prose must cover the added messages. A summary that covers only completed progress is drawn nowhere, so no message stands above it. The hint asks the same question of a run with the run added to the summaries in force. Folds without prose are held to the rule too; the threads reference, events.md and the command's help say so. The threads reference keeps "Leave out messages whose wording still matters" as it was, with the rule after it. The site's "How it works" page states the rule, and no longer says completed progress folds behind "Show N progress messages", which #3534 removed. `test_a_summary_inside_an_earlier_one_leaves_no_gap_above_a_later_one` reproduces both cases from review: on the previous commit, summarizing m1–m3 is admitted, and refusing m2–m3 names no range that closes the gap. It passes here, and the summaries then cover m1–m10. A randomized check run against this commit (not added to the suite) found no counterexample. It made 140 random threads with replies, progress, reactions, user edits and undos, and 1,448 random summary attempts. Of these, 620 were refused for a gap, and every refusal's named range was admitted. No admitted summary left a message in full above a summary, judged from the served thread as the panel draws it. In the half that checked it, each of 310 refusals matched that reading of the summary refused. All 63 hints it followed were admitted.
max-sixty
added a commit
that referenced
this pull request
Nov 15, 2026
…6049) A summary of a long thread could fold a middle stretch and leave older messages, just after the thread's first, in full above it. `leaf thread summarize` admitted any contiguous range, and #5583 fixed only how the hint picks its range, so a range the agent picked itself still left the gap. **The rule.** No message but the thread's opening one may stand in full above a summary. `events.summary_range` holds the rule. Given the summaries that stand once a new summary is written, it returns the range that summary must cover: the asked range, widened over every message left in full above the last drawn summary. Admission and the hint both call it. - The opening message may stay outside, since it says what the thread is about. - Progress that a later reply completed is drawn nowhere, so it doesn't count. A summary of completed progress alone is drawn nowhere either, so no message stands above it. - Pending progress is drawn, so it counts. - A reaction is a mark on another message and doesn't count. - Folds without prose (`--text ''`) are held to the rule too. Completed progress is already hidden (#3534), so a fold is no longer needed to tuck it away. **Admission.** Admission checks the thread as it will read once the new summary stands and has replaced the summaries it overlaps. So a summary that ends inside an earlier one can't uncover that one's tail above a later summary. When `summary_range` widens the asked range, admission refuses with `summary-gap` and names the wider range. That range is always admitted, because everything it replaces lies inside it and the messages it adds were all above the last summary. For example, with summaries over m1–m5 and m6–m10, a request for m1–m3 is refused with: ``` summary would leave messages unsummarized above a summary, and only the thread's opening message may stay there; summarize --from 'm1' --through 'm5', with prose that covers the added messages too ``` **The hint.** `summary_hint` takes the earliest run of uncovered messages that is long enough to suggest, and names the range `summary_range` gives for it, which is the range admission takes. Before, it could suggest a later run that left the gap. Without the widening, a short stretch left above a summary would stop the hint for good: when a rewrite retires a summary's prose, its messages stand uncovered above a later summary, and every longer run after them would leave them there. Now the hint names that later run widened over the stretch, replacing the summary between them. **Hints over a summary in force.** The issue expected that a hint never overlaps a summary in force. A hint now does exactly that when it must close a gap above that summary; otherwise it still stops at covered messages. The issue's own report of an overlapping hint doesn't reproduce on the code it was seen on, where every run stopped at covered messages. The likeliest source is a hint computed before that summary stood: a delivery captured before the summary was written, or a summary whose prose a rewrite or a taken-back message retired. That is an inference, not something I reproduced from the reported page. **Call Max may reverse.** The thread's opening message may stay outside a summary, so a summary can start at its second message. Requiring the opener to be folded too would mean changing only the `thread["id"]` clause in `summary_range`. ### Prose - `events.md`, the threads reference ("Summarize a long discussion") and the command's `--help` (regtest snapshot updated) state the rule, including folds without prose. - The threads reference keeps "Leave out messages whose wording still matters to the current exchange" as it was, with the rule after it. - The site's "How it works" page now states the rule. It no longer says completed progress folds behind "Show N progress messages", which #3534 removed. ### Tests In `tests/model/test_thread_reading.py`: - `test_a_summary_leaves_no_older_discussion_in_full_above_it` fails on main, where the gap-leaving range is admitted. It covers the opener, a reaction and completed progress above an admitted summary, a range that would replace a summary and uncover its start, and pending progress counting. Each refusal's named range is then admitted. - `test_a_summary_inside_an_earlier_one_leaves_no_gap_above_a_later_one` covers summarizing m1–m3, and m2–m3, inside a summary over m1–m5 with another over m6–m10. On the PR's first commit, which checked only above the new summary's start, m1–m3 is admitted, and the m2–m3 refusal names a range that leaves the same gap. Here each refusal names m1–m5, and once that is admitted the summaries cover m1–m10. - `test_a_summary_hint_names_only_a_range_admission_takes` replaces `test_summary_hint_takes_the_earliest_qualifying_run`, whose setup summarized a middle range that admission now refuses. A rewrite retires a summary's prose and leaves its run above a later fold. Where that run is long enough, the hint names it. Where it is too short, the hint names the next run widened over it, which no earlier version of this PR suggested. Both hinted ranges are admitted. `test_a_fold_pressed_in_a_thread_s_view_stays_under_the_press` (browser) summarized a range that left the agent's first answer above it. It now starts at that answer. I read every other `thread summarize` caller in the tests: each starts at the opener or its first reply. I also ran a randomized check against the final code, without adding it to the suite. It made random threads with replies, progress, reactions, user edits and undos, and tried random summary ranges and every hint it was given: - 537 attempts were refused for a gap, and every refusal's named range was admitted. - No admitted summary left a message in full above a summary, judged from the served thread as the panel draws it. - 137 hints were followed, none refused and none leaving a gap. ### Ran - `uv run pytest tests/model/test_thread_reading.py tests/model/test_model_folds.py tests/model/interact_contract/test_layer_contract.py tests/model/test_interact_layer.py tests/model/test_product_page.py -n 4`, plus the summary and hint tests in `test_interact_product.py`: 279 passed - `uv run pytest tests/browser/test_render_floating_panel.py tests/browser/threads/test_summaries.py -n 2 -k "fold_pressed_in_a_thread_s_view or keeps_completed_progress_hidden or search_and_leaf_s_travel or later_summary_replaces"`: 4 passed - `pre-commit` on the changed files ### Not verified - The threads-reference wording was not scored with `evals/`. The summary cases there (`thread-summary-after-topic-drift`, `thread-summary-preserves-needed-exchange`) expect ranges starting at the opener, which the rule still admits. - The journey `tests/journeys/threads/test_layout.py` and the rest of the browser summary tests didn't run. Each starts at the opener or its first reply, which I checked by reading. - The edited "How it works" page was not rendered. The change only replaces text inside two existing paragraphs, and `tests/model/test_product_page.py` passes. Closes #5531
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ephemeral progress messages now disappear when the next substantive agent reply is presented, including when that reply starts streaming. Completed progress no longer leaves a “Show progress messages” disclosure. Pending progress remains visible, and a held reply keeps its progress visible until the reader sees the answer.
The server associates progress with its completing reply, replacing automatic progress summaries. The browser applies that relation to the presented messages, including explicit summaries and failed streams retained in view. This also removes the obsolete summary trigger field and updates the conversation references and gallery.
Validated with 24 focused browser and journey cases, 27 model tests,
pnpm run check, pre-commit, and live desktop, dark, and phone previews. Startup comparison keeps 40 requests through first presentation and loads 592 fewer code bytes.CI also exposed an inherited failure in
test_saved_website_record_keeps_an_unstamped_revisions_publication_date: itsasyncio.runconflicts with an already-running sync Playwright driver. Reproduced on main atcb60147ebwith the driver active; the same test passes alone. This is independent of the progress-message change.