[PR #5303] [MERGED] Fix open Engine issues and complete file sharding #6716

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

📋 Pull Request Information

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

Base: staging ← Head: fix/open-issues-5299-5302


📝 Commits (7)

  • 239466f fix: restore agent retry cancellation
  • 4c951c1 feat: complete open issue sweep
  • b8357be fix: address open issue review findings
  • 51f2b6f fix: preserve lorebook world fallback
  • 04ceff5 fix: close retry cancellation races
  • e0ceff7 fix: finish retry cancellation review
  • c99654e fix: stop cancelled retries during setup

📊 Changes

29 files changed (+1621 additions, -389 deletions)

View changed files

📝 CHANGELOG.md (+4 -0)
📝 docs/agents/built-in-agents.md (+1 -1)
📝 docs/data/where-data-is-stored.md (+1 -1)
📝 docs/development/file-storage.md (+10 -6)
📝 e2e/core-flows.e2e.ts (+12 -0)
📝 packages/client/src/App.tsx (+2 -3)
📝 packages/client/src/components/chat/RoleplayHUDActionsMenu.tsx (+1 -1)
📝 packages/client/src/localization/locales/en.json (+4 -4)
📝 packages/server/src/db/file-backed-store.ts (+189 -143)
📝 packages/server/src/routes/chats.routes.ts (+13 -1)
📝 packages/server/src/routes/generate.routes.ts (+24 -11)
📝 packages/server/src/routes/generate/agent-write-approval.ts (+18 -0)
📝 packages/server/src/routes/generate/lorebook-keeper-utils.ts (+128 -2)
📝 packages/server/src/routes/generate/retry-agents-route.ts (+412 -126)
📝 packages/server/src/services/agents/agent-executor.ts (+11 -0)
📝 packages/server/src/services/generation/character-prompt-context.ts (+2 -0)
📝 packages/server/src/services/image/gallery-file-lifecycle.ts (+32 -6)
📝 packages/server/src/services/image/generated-image-entity-gallery.ts (+11 -0)
📝 packages/shared/src/types/agent.ts (+2 -0)
📝 scripts/protect-launcher-data.mjs (+78 -10)

...and 9 more files

📄 Description

Linked issue

Closes #5299
Closes #5301
Closes #5302
Refs #5300
Refs Pasta-Devs/Marinara-Agents#439

Why this change

  • Restore reliable cancellation for manually retried Agents, keep Desktop Mari functional with reduced ambient effects, and finish the file-storage sharding migration without monolithic table rewrites.
  • #5300 is being handled from its Android/Termux evidence separately because the captured process reached a healthy server startup and the reported background-activity setting change appears to resolve the OS process kill.

What changed

  • Registered forced Agent retries in the shared cancellable Agent-run registry and aligned the Stop Agents action with neighboring controls.
  • Kept reduced ambient effects separate from page/activity suspension so Desktop Mari can still navigate.
  • Moved every file-backed table onto the existing crash-safe shard pipeline, grouping child rows by stable owners and standalone rows by primary key. The offline downgrade/unshard path, migration notices, recovery behavior, and format guard now cover the complete table list.
  • Added the Engine half of Lorebook Keeper category routing: writable-book context, exact-name and alias destinations, safe chat-linked book creation, one-book fallback, and write-approval preservation. The package half is Pasta-Devs/Marinara-Agents#453.
  • Updated release notes and English storage/Agent documentation. Matching translated documentation is in #5304.

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

Automated proof completed locally:

  • pnpm check
  • pnpm version:check
  • scripts/regressions/open-issues.regression.ts
  • scripts/regressions/message-sharding.regression.ts
  • scripts/regressions/file-backed-shutdown.regression.ts
  • scripts/regressions/noodle/settings.regression.ts
  • scripts/regressions/roleplay-streaming.regression.ts
  • scripts/regressions/slurp-storage.regression.ts
  • scripts/regressions/launcher/format-guard.regression.mjs
  • Focused Playwright proof for reduced-effects Professor Mari navigation: 2 passed (desktop and mobile)

Manual verification notes

  • Manually verify Stop Agents during a forced Echo Chamber refresh.
  • Manually verify Desktop Mari tab navigation with reduced effects enabled.
  • Manually verify an upgrade from storage format 4 with representative large tables, then inspect ownership folders and the preserved .pre-shard files.
  • Manually verify Lorebook Keeper exact-name, configured-alias, and omitted-destination behavior with the package from Pasta-Devs/Marinara-Agents#453.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

  • The connected in-app browser service exposed no browser instance in this session. The focused desktop/mobile Playwright regression above is the available runtime UI proof; the manual click-through remains explicitly unchecked.

Summary by CodeRabbit

  • New Features

    • Lorebook Keeper updates can target lorebooks by exact name or aliases, with missing lorebooks created automatically.
    • Data storage now uses ownership-grouped files for improved reliability and migration handling.
  • Bug Fixes

    • Stopping agents now reliably cancels active retries and related background work.
    • Reduced ambient effects no longer completely pause interface effects.
    • Corrected Desktop Mari tab navigation.
    • Updated Stop Agents styling to a less destructive appearance.
  • Documentation

    • Expanded guidance for Lorebook Keeper routing and data storage.

🔄 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/5303 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 8/20/2026 **Status:** ✅ Merged **Merged:** 8/20/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/open-issues-5299-5302` --- ### 📝 Commits (7) - [`239466f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/239466f068a084ee29d0cab7c44a60fdc38b572d) fix: restore agent retry cancellation - [`4c951c1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4c951c1b8cb67907b1f2a33bbb0e5c3395fcdbad) feat: complete open issue sweep - [`b8357be`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b8357be3eed181d7fcf80f081cc4fac4c424533c) fix: address open issue review findings - [`51f2b6f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/51f2b6f26d3aae8c8ed6e8fe6a0961e99508dc03) fix: preserve lorebook world fallback - [`04ceff5`](https://github.com/Pasta-Devs/Marinara-Engine/commit/04ceff539276b5eb64e805c883f01f04eac14adf) fix: close retry cancellation races - [`e0ceff7`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e0ceff7b706fd8be76fea3a9038e33be0f68af9a) fix: finish retry cancellation review - [`c99654e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c99654e75db8c307369cf6d9e3725b6c8d12224b) fix: stop cancelled retries during setup ### 📊 Changes **29 files changed** (+1621 additions, -389 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+4 -0) 📝 `docs/agents/built-in-agents.md` (+1 -1) 📝 `docs/data/where-data-is-stored.md` (+1 -1) 📝 `docs/development/file-storage.md` (+10 -6) 📝 `e2e/core-flows.e2e.ts` (+12 -0) 📝 `packages/client/src/App.tsx` (+2 -3) 📝 `packages/client/src/components/chat/RoleplayHUDActionsMenu.tsx` (+1 -1) 📝 `packages/client/src/localization/locales/en.json` (+4 -4) 📝 `packages/server/src/db/file-backed-store.ts` (+189 -143) 📝 `packages/server/src/routes/chats.routes.ts` (+13 -1) 📝 `packages/server/src/routes/generate.routes.ts` (+24 -11) 📝 `packages/server/src/routes/generate/agent-write-approval.ts` (+18 -0) 📝 `packages/server/src/routes/generate/lorebook-keeper-utils.ts` (+128 -2) 📝 `packages/server/src/routes/generate/retry-agents-route.ts` (+412 -126) 📝 `packages/server/src/services/agents/agent-executor.ts` (+11 -0) 📝 `packages/server/src/services/generation/character-prompt-context.ts` (+2 -0) 📝 `packages/server/src/services/image/gallery-file-lifecycle.ts` (+32 -6) 📝 `packages/server/src/services/image/generated-image-entity-gallery.ts` (+11 -0) 📝 `packages/shared/src/types/agent.ts` (+2 -0) 📝 `scripts/protect-launcher-data.mjs` (+78 -10) _...and 9 more files_ </details> ### 📄 Description ## Linked issue Closes #5299 Closes #5301 Closes #5302 Refs #5300 Refs Pasta-Devs/Marinara-Agents#439 ## Why this change - Restore reliable cancellation for manually retried Agents, keep Desktop Mari functional with reduced ambient effects, and finish the file-storage sharding migration without monolithic table rewrites. - #5300 is being handled from its Android/Termux evidence separately because the captured process reached a healthy server startup and the reported background-activity setting change appears to resolve the OS process kill. ## What changed - Registered forced Agent retries in the shared cancellable Agent-run registry and aligned the Stop Agents action with neighboring controls. - Kept reduced ambient effects separate from page/activity suspension so Desktop Mari can still navigate. - Moved every file-backed table onto the existing crash-safe shard pipeline, grouping child rows by stable owners and standalone rows by primary key. The offline downgrade/unshard path, migration notices, recovery behavior, and format guard now cover the complete table list. - Added the Engine half of Lorebook Keeper category routing: writable-book context, exact-name and alias destinations, safe chat-linked book creation, one-book fallback, and write-approval preservation. The package half is Pasta-Devs/Marinara-Agents#453. - Updated release notes and English storage/Agent documentation. Matching translated documentation is in #5304. ## 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` Automated proof completed locally: - `pnpm check` - `pnpm version:check` - `scripts/regressions/open-issues.regression.ts` - `scripts/regressions/message-sharding.regression.ts` - `scripts/regressions/file-backed-shutdown.regression.ts` - `scripts/regressions/noodle/settings.regression.ts` - `scripts/regressions/roleplay-streaming.regression.ts` - `scripts/regressions/slurp-storage.regression.ts` - `scripts/regressions/launcher/format-guard.regression.mjs` - Focused Playwright proof for reduced-effects Professor Mari navigation: 2 passed (desktop and mobile) ### Manual verification notes - Manually verify Stop Agents during a forced Echo Chamber refresh. - Manually verify Desktop Mari tab navigation with reduced effects enabled. - Manually verify an upgrade from storage format 4 with representative large tables, then inspect ownership folders and the preserved `.pre-shard` files. - Manually verify Lorebook Keeper exact-name, configured-alias, and omitted-destination behavior with the package from Pasta-Devs/Marinara-Agents#453. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) - The connected in-app browser service exposed no browser instance in this session. The focused desktop/mobile Playwright regression above is the available runtime UI proof; the manual click-through remains explicitly unchecked. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Lorebook Keeper updates can target lorebooks by exact name or aliases, with missing lorebooks created automatically. * Data storage now uses ownership-grouped files for improved reliability and migration handling. * **Bug Fixes** * Stopping agents now reliably cancels active retries and related background work. * Reduced ambient effects no longer completely pause interface effects. * Corrected Desktop Mari tab navigation. * Updated Stop Agents styling to a less destructive appearance. * **Documentation** * Expanded guidance for Lorebook Keeper routing and data storage. <!-- 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:02 +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#6716
No description provided.