[GH-ISSUE #4246] [Feature]: Preserve contained rolling summaries across chat branches #2298

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

Originally created by @Promansis on GitHub (Jul 29, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4246

Originally assigned to: @Promansis on GitHub.

What problem does this solve?

Creating a chat branch currently risks losing rolling summary context from the parent chat. Users who branch before a summary boundary should retain summaries that describe only messages copied into the new branch, while summaries that cross the branch point must not be copied because their source context is incomplete.

Proposed solution

When creating a chat branch, carry over rolling summaries whose persisted source message ranges are fully contained in the copied parent range. Remap their source and hidden message IDs to the new branch IDs, rebuild the child summary metadata, and remap automatic-summary tracking. Exclude summaries whose source range crosses the branch point and legacy summaries without verifiable message metadata.

Also provide an optional built-in Long-Term Memory chat-summary prompt that is visible only when the Long-Term Memory agent is active, persists through the existing summary prompt settings, and safely falls back when unavailable.

Alternatives considered

  • Copy every parent summary, which can expose context from messages that are not present in the branch.
  • Copy summaries by stored array position only, which is unsafe when messages are deleted, hidden, swiped, or otherwise remapped.
  • Recreate all summaries in the child branch, which is more expensive and changes existing summary text unnecessarily.
  • Require users to manually recreate summary context after branching, which loses useful continuity.

Additional context

The implementation is on fix/chat-summary-branch-inheritance and includes focused prompt regression coverage. The branch is based on current upstream/staging.

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @Promansis on GitHub (Jul 29, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4246 Originally assigned to: @Promansis on GitHub. ## What problem does this solve? Creating a chat branch currently risks losing rolling summary context from the parent chat. Users who branch before a summary boundary should retain summaries that describe only messages copied into the new branch, while summaries that cross the branch point must not be copied because their source context is incomplete. ## Proposed solution When creating a chat branch, carry over rolling summaries whose persisted source message ranges are fully contained in the copied parent range. Remap their source and hidden message IDs to the new branch IDs, rebuild the child summary metadata, and remap automatic-summary tracking. Exclude summaries whose source range crosses the branch point and legacy summaries without verifiable message metadata. Also provide an optional built-in Long-Term Memory chat-summary prompt that is visible only when the Long-Term Memory agent is active, persists through the existing summary prompt settings, and safely falls back when unavailable. ## Alternatives considered - Copy every parent summary, which can expose context from messages that are not present in the branch. - Copy summaries by stored array position only, which is unsafe when messages are deleted, hidden, swiped, or otherwise remapped. - Recreate all summaries in the child branch, which is more expensive and changes existing summary text unnecessarily. - Require users to manually recreate summary context after branching, which loses useful continuity. ## Additional context The implementation is on `fix/chat-summary-branch-inheritance` and includes focused prompt regression coverage. The branch is based on current `upstream/staging`. ## Template check - [ ] I DID NOT read this template and provide the requested details.
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#2298
No description provided.