mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2820] [Feature]: Rolling summary token compression for roleplay (auto-hide summarized messages with a tail) #1429
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#1429
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 23, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2820
Originally assigned to: @Romuromylus on GitHub.
What problem does this solve?
In roleplay / visual-novel mode the rolling summary runs automatically every N user messages and injects a recap into the prompt, but it never hides the messages it just summarized. The originals stay in context, so each summary is a net token increase layered on top of the history it was meant to compress — the opposite of what a rolling summary is for. The only ways to actually save tokens today are to manually cap context messages in Advanced Parameters, or to manually generate a summary in the Summary popover with "Hide summarised messages" ticked — and even that hides everything the summary touched with no tail, so the most recent turns can vanish and break conversational flow.
Concretely, on
staging(119df4d0):ChatSummaryEntrycarryingmessageIdsbut never calls the bulk-hide path, so the summarized originals stay visible (packages/server/src/routes/generate.routes.ts~7329–7346).summaryPopoverSettings.hideSummarisedMessages), not part ofChatMetadata, so the server auto-summary cannot read it. It only fires on manual generation (packages/client/src/components/chat/SummaryPopover.tsx:500–534).summaryTailMessagesalready exists inChatMetadataand is honored for conversation-mode day/week summaries, but is not wired into roleplay summaries (packages/shared/src/types/chat.ts:476, read atpackages/server/src/routes/generate.routes.ts:2654).packages/client/src/components/chat/SummaryPopover.tsx:643–666).Proposed solution
Wire the pieces that already exist (
hiddenFromAI, per-entrymessageIds, thebulkSetMessagesHiddenFromAIAPI, the collapsible hidden-message UI) into the automatic roleplay summary path:hiddenFromAI, but respect a configurable tail so the last N messages always stay visible. This makes the summary actually compress context instead of inflating it.summaryTailMessagesfor roleplay — reuse the existing field and slider (today conversation-mode only) so roleplay gets a per-chat control for how many recent messages stay visible after auto-hiding.Alternatives considered
Additional context
refactorline; the gap is still present onstaging.staging(119df4d0) before filing.Template check