[PR #2840] [MERGED] fix(summary): restore auto-hide for roleplay rolling summaries #5763

Closed
opened 2026-10-22 04:19:17 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/2840
Author: @Romuromylus
Created: 6/23/2026
Status: ✅ Merged
Merged: 6/23/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/2820-reapply-auto-summary-hide


📝 Commits (1)

  • a2a2172 fix(summary): restore auto-hide for roleplay rolling summaries

📊 Changes

1 file changed (+29 additions, -2 deletions)

View changed files

📝 packages/server/src/routes/generate.routes.ts (+29 -2)

📄 Description

Linked issue

Re-applies the auto-hide behavior from #2820 / #2821, which regressed on staging after merge. No separate regression issue was opened — this PR documents the regression below.

Why this change

The roleplay rolling-summary auto-hide shipped in #2821, but commit f955a646 ("Local models should get the tools block") inadvertently reverted it. That commit's branch was based on an older staging (before #2821 merged); when it landed, its copy of generate.routes.ts overwrote the auto-hide orchestration while correctly adding the tools block. As a result, automatic rolling summaries stopped hiding the messages they covered, so the summary no longer reduces prompt tokens.

Manual summaries and unhide-on-delete were not touched by the conflict and still work — only the automatic path regressed. The supporting helpers (computeSummaryHideIds, resolveRoleplaySummaryTail), the storage method (bulkSetHiddenFromAI), and the manual-hide route all survived, so this is a faithful re-application with no new logic.

What changed

packages/server/src/routes/generate.routes.ts (automatic-summary path only):

  • Re-add the computeSummaryHideIds / resolveRoleplaySummaryTail imports.
  • Recompute autoHideIds up front, gated on the per-chat hideSummarisedMessages setting and excluding the protected recent tail (summaryTailMessages).
  • Persist hiddenMessageIds on the summary entry so deleting the entry restores exactly the set it hid.
  • Call bulkSetHiddenFromAI and echo hiddenMessageIds back in the chat_summary SSE payload.

The tools-block change from f955a646 is left intact (verified present after this patch).

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • pnpm check run locally → exit 0 (TypeScript + ESLint + client build all clean).
  • The two restored blocks were diffed byte-for-byte against their #2821 originals — identical.
  • To verify in a running app: in roleplay mode, enable Hide summarised messages, trigger an automatic rolling summary, and confirm the covered messages (minus the recent tail) become hidden from the AI; then delete the summary entry and confirm exactly those messages unhide.

Docs and release impact

  • No docs changes needed

UI evidence (if applicable)

Server-only change; no UI surface added. Behavior is observable via the message hidden-from-AI state after an automatic summary.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/2840 **Author:** [@Romuromylus](https://github.com/Romuromylus) **Created:** 6/23/2026 **Status:** ✅ Merged **Merged:** 6/23/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/2820-reapply-auto-summary-hide` --- ### 📝 Commits (1) - [`a2a2172`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a2a2172abd36861102de071dab35a1f5bae7dc0e) fix(summary): restore auto-hide for roleplay rolling summaries ### 📊 Changes **1 file changed** (+29 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/routes/generate.routes.ts` (+29 -2) </details> ### 📄 Description ## Linked issue Re-applies the auto-hide behavior from #2820 / #2821, which regressed on `staging` after merge. No separate regression issue was opened — this PR documents the regression below. ## Why this change The roleplay rolling-summary auto-hide shipped in #2821, but commit `f955a646` ("Local models should get the tools block") inadvertently reverted it. That commit's branch was based on an older `staging` (before #2821 merged); when it landed, its copy of `generate.routes.ts` overwrote the auto-hide orchestration while correctly adding the tools block. As a result, **automatic** rolling summaries stopped hiding the messages they covered, so the summary no longer reduces prompt tokens. Manual summaries and unhide-on-delete were not touched by the conflict and still work — only the automatic path regressed. The supporting helpers (`computeSummaryHideIds`, `resolveRoleplaySummaryTail`), the storage method (`bulkSetHiddenFromAI`), and the manual-hide route all survived, so this is a faithful re-application with no new logic. ## What changed `packages/server/src/routes/generate.routes.ts` (automatic-summary path only): - Re-add the `computeSummaryHideIds` / `resolveRoleplaySummaryTail` imports. - Recompute `autoHideIds` up front, gated on the per-chat `hideSummarisedMessages` setting and excluding the protected recent tail (`summaryTailMessages`). - Persist `hiddenMessageIds` on the summary entry so deleting the entry restores exactly the set it hid. - Call `bulkSetHiddenFromAI` and echo `hiddenMessageIds` back in the `chat_summary` SSE payload. The tools-block change from `f955a646` is left intact (verified present after this patch). ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes - `pnpm check` run locally → exit 0 (TypeScript + ESLint + client build all clean). - The two restored blocks were diffed byte-for-byte against their #2821 originals — identical. - To verify in a running app: in roleplay mode, enable **Hide summarised messages**, trigger an automatic rolling summary, and confirm the covered messages (minus the recent tail) become hidden from the AI; then delete the summary entry and confirm exactly those messages unhide. ## Docs and release impact - [x] No docs changes needed ## UI evidence (if applicable) Server-only change; no UI surface added. Behavior is observable via the message hidden-from-AI state after an automatic summary. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:19:17 +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#5763
No description provided.