[PR #4847] [MERGED] Fix restored history, vectorization, swipe navigation, and Gallery agents #6516

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

📋 Pull Request Information

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

Base: staging ← Head: agent/assigned-issue-sweep-aug-10-round-2


📝 Commits (7)

  • 39aa2b9 chore: start assigned issue sweep
  • 263f1d8 fix: resolve assigned chat and vectorization issues
  • 0b2de39 test: cover Gallery agent picker on mobile
  • 58d8d7b fix: apply CodeRabbit review feedback
  • 2fbb766 fix: keep Lorebook editor open after failed save
  • 649a012 fix: guard Lorebook save and vectorization races
  • 3262e33 fix: serialize Lorebook vectorization flow

📊 Changes

19 files changed (+930 additions, -118 deletions)

View changed files

📝 CHANGELOG.md (+5 -0)
📝 e2e/core-flows.e2e.ts (+369 -0)
📝 package.json (+1 -1)
📝 packages/client/src/components/chat/ChatArea.tsx (+10 -3)
📝 packages/client/src/components/chat/ChatCommonOverlays.tsx (+3 -0)
📝 packages/client/src/components/chat/ChatGallery.tsx (+85 -20)
📝 packages/client/src/components/chat/ChatGalleryDrawer.tsx (+34 -2)
📝 packages/client/src/components/chat/ChatRoleplaySurface.tsx (+3 -0)
📝 packages/client/src/components/chat/ChatSettingsDrawer.tsx (+32 -3)
📝 packages/client/src/components/chat/ConversationView.tsx (+1 -0)
📝 packages/client/src/components/game/GameSurface.tsx (+3 -0)
📝 packages/client/src/components/lorebooks/LorebookEditor.tsx (+103 -68)
📝 packages/client/src/hooks/use-capability-packages.ts (+2 -1)
📝 packages/client/src/localization/locales/en.json (+8 -0)
📝 packages/server/src/db/file-backed-store.ts (+44 -10)
📝 packages/server/src/routes/lorebooks.routes.ts (+8 -1)
📝 packages/server/src/services/memory-recall.ts (+38 -9)
➕ scripts/regressions/memory-recall-revectorize.regression.ts (+81 -0)
📝 scripts/regressions/message-sharding.regression.ts (+100 -0)

📄 Description

Why

Five assigned reports expose separate but user-visible dead ends: Conversation swipe navigation watches the wrong scroll surface; re-vectorization can race background memory work; Lorebook vectorization can execute before pending settings are saved and then report a misleading zero result; a restored profile can retain its pre-shard message backup while exposing no history; and custom image agents cannot be launched from the Gallery.

Scope

Changes

  • Resolve intuitive swipe gestures from the nearest marked Conversation or Roleplay transcript while preserving interactive-control guards.
  • Serialize background Memory Recall writes and full re-vectorization per chat, and expose an explicit Re-vectorize All action with confirmation and feedback.
  • Save pending Lorebook vector settings before vectorization and return actionable eligibility failures instead of silent zero-success responses.
  • Recover a manifest-expected history from a preserved pre-shard table only when no current shards exist; empty and partial histories remain untouched.
  • Let Gallery Illustrate choose between the active base Illustrator and active custom image-producing agents on desktop and mobile.
  • Add focused browser and server regressions for every repaired boundary.

Validation

  • Run pnpm check
  • Run pnpm localization:check
  • Run the message-sharding and Memory Recall re-vectorization regressions
  • Run focused mobile Conversation and Roleplay swipe coverage
  • Manually verify the Gallery selector in desktop and mobile layouts

Risk notes

The restored-history repair only recovers a preserved pre-shard backup when the current manifest expects rows and no shard data exists; it never merges ambiguous partial histories. Memory work is serialized per chat and releases its queue entry after completion. Gallery preserves its existing one-click behavior whenever no eligible custom image agent is active.

Summary by CodeRabbit

  • New Features
    • Added Gallery support for selecting active custom image-generation agents and retrying image generation with a chosen agent.
    • Added a confirmed “Re-vectorize All Memories” action with status reporting and error handling.
  • Bug Fixes
    • Improved mobile swipe navigation for conversation and roleplay alternatives.
    • Lorebook vectorization now saves pending changes first and reports excluded-content errors.
    • Improved memory re-vectorization reliability during concurrent updates.
    • Restored chat history when sharded backups are missing or incomplete.
  • Tests
    • Added regression coverage for Gallery agents, swipe navigation, lorebook settings, memory re-vectorization, and chat-history recovery.

🔄 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/4847 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 8/10/2026 **Status:** ✅ Merged **Merged:** 8/10/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `agent/assigned-issue-sweep-aug-10-round-2` --- ### 📝 Commits (7) - [`39aa2b9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/39aa2b9ca215a179292a807a1d8b0ad2488fb035) chore: start assigned issue sweep - [`263f1d8`](https://github.com/Pasta-Devs/Marinara-Engine/commit/263f1d8baeabb83da054f50147e6409547d6e999) fix: resolve assigned chat and vectorization issues - [`0b2de39`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0b2de397e89612fca27b63e89f58750764ea8a3f) test: cover Gallery agent picker on mobile - [`58d8d7b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/58d8d7b790a43445c2842c44172fad5b0324352b) fix: apply CodeRabbit review feedback - [`2fbb766`](https://github.com/Pasta-Devs/Marinara-Engine/commit/2fbb7668c5c1377665c840fadec0a5a297183044) fix: keep Lorebook editor open after failed save - [`649a012`](https://github.com/Pasta-Devs/Marinara-Engine/commit/649a0128019867709028af224c6054a44d9ee697) fix: guard Lorebook save and vectorization races - [`3262e33`](https://github.com/Pasta-Devs/Marinara-Engine/commit/3262e336bb72824132518e56d4833d5157c00880) fix: serialize Lorebook vectorization flow ### 📊 Changes **19 files changed** (+930 additions, -118 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+5 -0) 📝 `e2e/core-flows.e2e.ts` (+369 -0) 📝 `package.json` (+1 -1) 📝 `packages/client/src/components/chat/ChatArea.tsx` (+10 -3) 📝 `packages/client/src/components/chat/ChatCommonOverlays.tsx` (+3 -0) 📝 `packages/client/src/components/chat/ChatGallery.tsx` (+85 -20) 📝 `packages/client/src/components/chat/ChatGalleryDrawer.tsx` (+34 -2) 📝 `packages/client/src/components/chat/ChatRoleplaySurface.tsx` (+3 -0) 📝 `packages/client/src/components/chat/ChatSettingsDrawer.tsx` (+32 -3) 📝 `packages/client/src/components/chat/ConversationView.tsx` (+1 -0) 📝 `packages/client/src/components/game/GameSurface.tsx` (+3 -0) 📝 `packages/client/src/components/lorebooks/LorebookEditor.tsx` (+103 -68) 📝 `packages/client/src/hooks/use-capability-packages.ts` (+2 -1) 📝 `packages/client/src/localization/locales/en.json` (+8 -0) 📝 `packages/server/src/db/file-backed-store.ts` (+44 -10) 📝 `packages/server/src/routes/lorebooks.routes.ts` (+8 -1) 📝 `packages/server/src/services/memory-recall.ts` (+38 -9) ➕ `scripts/regressions/memory-recall-revectorize.regression.ts` (+81 -0) 📝 `scripts/regressions/message-sharding.regression.ts` (+100 -0) </details> ### 📄 Description ## Why Five assigned reports expose separate but user-visible dead ends: Conversation swipe navigation watches the wrong scroll surface; re-vectorization can race background memory work; Lorebook vectorization can execute before pending settings are saved and then report a misleading zero result; a restored profile can retain its pre-shard message backup while exposing no history; and custom image agents cannot be launched from the Gallery. ## Scope - Fixes #4841 - Fixes #4843 - Fixes #4844 - Fixes #4845 - Fixes #4846 ## Changes - Resolve intuitive swipe gestures from the nearest marked Conversation or Roleplay transcript while preserving interactive-control guards. - Serialize background Memory Recall writes and full re-vectorization per chat, and expose an explicit Re-vectorize All action with confirmation and feedback. - Save pending Lorebook vector settings before vectorization and return actionable eligibility failures instead of silent zero-success responses. - Recover a manifest-expected history from a preserved pre-shard table only when no current shards exist; empty and partial histories remain untouched. - Let Gallery Illustrate choose between the active base Illustrator and active custom image-producing agents on desktop and mobile. - Add focused browser and server regressions for every repaired boundary. ## Validation - [ ] Run pnpm check - [ ] Run pnpm localization:check - [ ] Run the message-sharding and Memory Recall re-vectorization regressions - [ ] Run focused mobile Conversation and Roleplay swipe coverage - [ ] Manually verify the Gallery selector in desktop and mobile layouts ## Risk notes The restored-history repair only recovers a preserved pre-shard backup when the current manifest expects rows and no shard data exists; it never merges ambiguous partial histories. Memory work is serialized per chat and releases its queue entry after completion. Gallery preserves its existing one-click behavior whenever no eligible custom image agent is active. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added Gallery support for selecting active custom image-generation agents and retrying image generation with a chosen agent. * Added a confirmed “Re-vectorize All Memories” action with status reporting and error handling. * **Bug Fixes** * Improved mobile swipe navigation for conversation and roleplay alternatives. * Lorebook vectorization now saves pending changes first and reports excluded-content errors. * Improved memory re-vectorization reliability during concurrent updates. * Restored chat history when sharded backups are missing or incomplete. * **Tests** * Added regression coverage for Gallery agents, swipe navigation, lorebook settings, memory re-vectorization, and chat-history recovery. <!-- 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:11:10 +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#6516
No description provided.