mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2879] [Issue]: Summarization doesn't hide previously-summarized tail messages on later runs #1462
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#1462
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
Environment
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 (computeSummaryHideIdsinpackages/server/src/routes/generate/generate-route-utils.ts, also used by the manual summarize path inpackages/server/src/routes/chats.routes.ts). Each entry'shiddenMessageIdsis frozen at creation as "this batch minus the protected tail". When a previous summary's tail drifts outside the next run'sslice(-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