[GH-ISSUE #2879] [Issue]: Summarization doesn't hide previously-summarized tail messages on later runs #1462

Closed
opened 2026-10-21 05:35:48 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Romuromylus on GitHub (Jun 25, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2879

Originally assigned to: @Romuromylus on GitHub.

Summary

In Roleplay mode with "Hide summarised messages" enabled and a nonzero summary tail, messages that were kept visible as the tail of one summary are never hidden by later summaries once they fall outside the next summary's context window, so they accumulate as stale visible context.

Expected behavior

After a later summary runs, previously-summarized messages that are no longer within the protected recent-message tail should be hidden, just like the first summary hides everything it summarized except its tail.

Actual behavior

The first summary hides everything except the last N visible messages (the tail). On the next summary run, those old tail messages drift outside the new context window and are never re-claimed, so they stay visible indefinitely and pile up. Over several summaries the visible context ends up holding several stranded "tail" windows (e.g. messages 20–25 and 45–50) that should have been hidden.

Steps to reproduce

  1. Roleplay chat with "Hide summarised messages" on and a summary tail greater than 0.
  2. Let an automatic summary run (it summarizes a batch and keeps the last few messages visible as the tail).
  3. Continue the chat so several more messages accumulate, then let the next summary run.
  4. The previous tail messages remain visible even though they were already summarized; repeat and they keep accumulating.

Environment

  • Marinara Engine version: 2.0.5
  • Install type: source
  • OS + version: Windows 10 22H2
  • Browser or app shell: web

Logs, screenshots, or video

Reported in the community Discord with a code-level walkthrough; reproducible by inspecting which messages remain visible across two consecutive summary runs with a nonzero tail.

Additional context

Root cause: the automatic summary selects its batch with selectedMessages = visible.slice(-contextSize) (packages/server/src/routes/generate.routes.ts), and that same set bounds the hide computation (computeSummaryHideIds in packages/server/src/routes/generate/generate-route-utils.ts, also used by the manual summarize path in packages/server/src/routes/chats.routes.ts). Each entry's hiddenMessageIds is frozen at creation as "this batch minus the protected tail". When a previous summary's tail drifts outside the next run's slice(-contextSize) window, it is no longer in any new entry's batch, and since the old entry's hidden set was frozen without it, no live entry ever hides it. The fix is to extend the hide window backward to bridge to the previous summary boundary so stranded tail messages are reclaimed.

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @Romuromylus on GitHub (Jun 25, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2879 Originally assigned to: @Romuromylus on GitHub. ## Summary In Roleplay mode with "Hide summarised messages" enabled and a nonzero summary tail, messages that were kept visible as the tail of one summary are never hidden by later summaries once they fall outside the next summary's context window, so they accumulate as stale visible context. ## Expected behavior After a later summary runs, previously-summarized messages that are no longer within the protected recent-message tail should be hidden, just like the first summary hides everything it summarized except its tail. ## Actual behavior The first summary hides everything except the last N visible messages (the tail). On the next summary run, those old tail messages drift outside the new context window and are never re-claimed, so they stay visible indefinitely and pile up. Over several summaries the visible context ends up holding several stranded "tail" windows (e.g. messages 20–25 and 45–50) that should have been hidden. ## Steps to reproduce 1. Roleplay chat with "Hide summarised messages" on and a summary tail greater than 0. 2. Let an automatic summary run (it summarizes a batch and keeps the last few messages visible as the tail). 3. Continue the chat so several more messages accumulate, then let the next summary run. 4. The previous tail messages remain visible even though they were already summarized; repeat and they keep accumulating. ## Environment - Marinara Engine version: 2.0.5 - Install type: source - OS + version: Windows 10 22H2 - Browser or app shell: web ## Logs, screenshots, or video Reported in the community Discord with a code-level walkthrough; reproducible by inspecting which messages remain visible across two consecutive summary runs with a nonzero tail. ## Additional context Root cause: the automatic summary selects its batch with `selectedMessages = visible.slice(-contextSize)` (`packages/server/src/routes/generate.routes.ts`), and that same set bounds the hide computation (`computeSummaryHideIds` in `packages/server/src/routes/generate/generate-route-utils.ts`, also used by the manual summarize path in `packages/server/src/routes/chats.routes.ts`). Each entry's `hiddenMessageIds` is frozen at creation as "this batch minus the protected tail". When a previous summary's tail drifts outside the next run's `slice(-contextSize)` window, it is no longer in any new entry's batch, and since the old entry's hidden set was frozen without it, no live entry ever hides it. The fix is to extend the hide window backward to bridge to the previous summary boundary so stranded tail messages are reclaimed. ## Template check - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 05:35:48 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#1462
No description provided.