[PR #5398] [MERGED] feat: add lorebook backfill and summary bulk actions #6753

Closed
opened 2026-10-23 04:13:23 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5398
Author: @SpicyMarinara
Created: 8/22/2026
Status: ✅ Merged
Merged: 8/22/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/issue-sweep-5391-5394


📝 Commits (5)

  • 20173dc chore: start issue sweep 5391 5394
  • 5c7c809 feat: add lorebook backfill and summary bulk actions
  • a0089cf fix: harden issue sweep edge cases
  • 520b805 fix: serialize summary and backfill effects
  • db719ad fix: gate backfill cursor on persistence

📊 Changes

19 files changed (+1115 additions, -233 deletions)

View changed files

📝 CHANGELOG.md (+2 -0)
📝 packages/client/src/components/agents/AgentEditor.tsx (+79 -5)
📝 packages/client/src/components/chat/ChatSettingsDrawer.tsx (+101 -0)
📝 packages/client/src/components/chat/SummaryPopover.tsx (+79 -14)
📝 packages/client/src/hooks/use-chats.ts (+4 -3)
📝 packages/client/src/hooks/use-generate.ts (+14 -1)
📝 packages/client/src/localization/locales/en.json (+16 -0)
📝 packages/server/src/db/seed-mari.ts (+4 -4)
📝 packages/server/src/routes/chats.routes.ts (+91 -113)
📝 packages/server/src/routes/generate.routes.ts (+78 -71)
📝 packages/server/src/routes/generate/lorebook-keeper-utils.ts (+84 -10)
📝 packages/server/src/routes/generate/retry-agents-route.ts (+123 -5)
📝 packages/server/src/services/conversation/character-commands.ts (+24 -2)
📝 packages/server/src/services/generation/professor-mari-command-runtime.ts (+95 -1)
📝 packages/server/src/services/generation/tool-resolution-runtime.ts (+13 -1)
📝 packages/server/src/services/storage/chats.storage.ts (+4 -3)
📝 packages/shared/src/utils/chat-summary-entries.ts (+18 -0)
➕ scripts/regressions/issue-sweep-5391-5394.regression.ts (+218 -0)
📝 scripts/regressions/manual-agent-retry-resolution.regression.ts (+68 -0)

📄 Description

Linked issue

Closes #5391
Closes #5394

Why this change

Users need a supported path for nested lorebook organization and bounded custom-agent history backfills. Summariser users also need to clear selected entries safely before rebuilding summaries.

What changed

  • Let Professor Mari create and reuse nested lorebook folder paths and place or move entries into them.
  • Add opt-in custom lorebook-agent backfill settings in the Agent editor and Chat Settings, with a configurable message chunk and a persistent success cursor.
  • Allow lorebook-update custom agents to retain an explicitly selected writable target without requiring the prebuilt write tool.
  • Add Select all and confirmed bulk deletion to the Summariser, including the promised behavior when deleting one of multiple selected rows.
  • Restore message visibility only when no retained enabled summary still covers the message.
  • Add localization, release notes, and a focused regression proof.

Validation

  • Run pnpm check
  • Run prompt regressions
  • Run the issue sweep regression
  • Manually verify nested folder creation through Professor Mari
  • Manually verify successive custom-agent backfill chunks and completion state
  • Manually verify Summariser select-all, confirmation, and multi-delete
  • Check light and dark themes plus desktop and mobile layouts
  • Read and follow CONTRIBUTING.md

Local evidence

  • pnpm check passed.
  • Prompt regressions passed.
  • The focused #5391/#5394 regression passed.
  • Focused desktop and mobile browser cases for custom-agent UI and Roleplay Summaries passed: 4/4.
  • The broader UI run was stopped after its local webserver crashed with a native mutex error; the affected focused cases passed against a fresh server.

Docs and release impact

  • No user-facing docs changes are needed; controls are localized in context.
  • CHANGELOG Unreleased entries are present for both issues.
  • No version or release metadata bump is needed.

UI evidence (if applicable)

Manual verification remains listed above.

Summary by CodeRabbit

  • New Features

    • Custom agents can backfill lorebook history in configurable chunks, with controls to enable, pause, and process the next chunk.
    • Lorebook commands now support nested folder paths, including automatic folder creation and entry placement.
    • Roleplay Summariser entries support selecting, deleting, and confirming deletion of multiple entries at once.
  • Bug Fixes

    • Restored message visibility correctly after deleting summary entries.
    • Improved backfill status notifications and prevented duplicate lorebook entries on repeated requests.

🔄 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/5398 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 8/22/2026 **Status:** ✅ Merged **Merged:** 8/22/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/issue-sweep-5391-5394` --- ### 📝 Commits (5) - [`20173dc`](https://github.com/Pasta-Devs/Marinara-Engine/commit/20173dc430cc8e09064544a366cddb60bf70f156) chore: start issue sweep 5391 5394 - [`5c7c809`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5c7c809797d09ac0a0752ed92144092841edf437) feat: add lorebook backfill and summary bulk actions - [`a0089cf`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a0089cf21170963aeb4bd94b4647ff54c7cc430d) fix: harden issue sweep edge cases - [`520b805`](https://github.com/Pasta-Devs/Marinara-Engine/commit/520b805ab05c68e5da2c4d9f077fe1ae6190fc57) fix: serialize summary and backfill effects - [`db719ad`](https://github.com/Pasta-Devs/Marinara-Engine/commit/db719ad05c45c2388ebee4b92463e16e3a569660) fix: gate backfill cursor on persistence ### 📊 Changes **19 files changed** (+1115 additions, -233 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+2 -0) 📝 `packages/client/src/components/agents/AgentEditor.tsx` (+79 -5) 📝 `packages/client/src/components/chat/ChatSettingsDrawer.tsx` (+101 -0) 📝 `packages/client/src/components/chat/SummaryPopover.tsx` (+79 -14) 📝 `packages/client/src/hooks/use-chats.ts` (+4 -3) 📝 `packages/client/src/hooks/use-generate.ts` (+14 -1) 📝 `packages/client/src/localization/locales/en.json` (+16 -0) 📝 `packages/server/src/db/seed-mari.ts` (+4 -4) 📝 `packages/server/src/routes/chats.routes.ts` (+91 -113) 📝 `packages/server/src/routes/generate.routes.ts` (+78 -71) 📝 `packages/server/src/routes/generate/lorebook-keeper-utils.ts` (+84 -10) 📝 `packages/server/src/routes/generate/retry-agents-route.ts` (+123 -5) 📝 `packages/server/src/services/conversation/character-commands.ts` (+24 -2) 📝 `packages/server/src/services/generation/professor-mari-command-runtime.ts` (+95 -1) 📝 `packages/server/src/services/generation/tool-resolution-runtime.ts` (+13 -1) 📝 `packages/server/src/services/storage/chats.storage.ts` (+4 -3) 📝 `packages/shared/src/utils/chat-summary-entries.ts` (+18 -0) ➕ `scripts/regressions/issue-sweep-5391-5394.regression.ts` (+218 -0) 📝 `scripts/regressions/manual-agent-retry-resolution.regression.ts` (+68 -0) </details> ### 📄 Description ## Linked issue Closes #5391 Closes #5394 ## Why this change Users need a supported path for nested lorebook organization and bounded custom-agent history backfills. Summariser users also need to clear selected entries safely before rebuilding summaries. ## What changed - Let Professor Mari create and reuse nested lorebook folder paths and place or move entries into them. - Add opt-in custom lorebook-agent backfill settings in the Agent editor and Chat Settings, with a configurable message chunk and a persistent success cursor. - Allow lorebook-update custom agents to retain an explicitly selected writable target without requiring the prebuilt write tool. - Add Select all and confirmed bulk deletion to the Summariser, including the promised behavior when deleting one of multiple selected rows. - Restore message visibility only when no retained enabled summary still covers the message. - Add localization, release notes, and a focused regression proof. ## Validation - [ ] Run pnpm check - [ ] Run prompt regressions - [ ] Run the issue sweep regression - [ ] Manually verify nested folder creation through Professor Mari - [ ] Manually verify successive custom-agent backfill chunks and completion state - [ ] Manually verify Summariser select-all, confirmation, and multi-delete - [ ] Check light and dark themes plus desktop and mobile layouts - [ ] Read and follow CONTRIBUTING.md ### Local evidence - pnpm check passed. - Prompt regressions passed. - The focused #5391/#5394 regression passed. - Focused desktop and mobile browser cases for custom-agent UI and Roleplay Summaries passed: 4/4. - The broader UI run was stopped after its local webserver crashed with a native mutex error; the affected focused cases passed against a fresh server. ## Docs and release impact - [ ] No user-facing docs changes are needed; controls are localized in context. - [ ] CHANGELOG Unreleased entries are present for both issues. - [ ] No version or release metadata bump is needed. ## UI evidence (if applicable) Manual verification remains listed above. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Custom agents can backfill lorebook history in configurable chunks, with controls to enable, pause, and process the next chunk. * Lorebook commands now support nested folder paths, including automatic folder creation and entry placement. * Roleplay Summariser entries support selecting, deleting, and confirming deletion of multiple entries at once. * **Bug Fixes** * Restored message visibility correctly after deleting summary entries. * Improved backfill status notifications and prevented duplicate lorebook entries on repeated requests. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:13:23 +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#6753
No description provided.