[PR #6466] [MERGED] fix: recover memory preparation and add scene deletion #7190

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

📋 Pull Request Information

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

Base: staging ← Head: codex/sept20-memory-summary-contract


📝 Commits (2)

  • 50dcd97 chore: coordinate memory summary follow-up
  • c5d9dd9 fix: recover memory preparation and add scene deletion

📊 Changes

9 files changed (+388 additions, -72 deletions)

View changed files

📝 CHANGELOG.md (+3 -0)
📝 docs/agents/memory.md (+7 -5)
📝 e2e/advanced-memory.e2e.ts (+38 -2)
📝 packages/client/src/components/chat/AdvancedMemoryInspector.tsx (+30 -0)
📝 packages/client/src/hooks/use-advanced-memory.ts (+3 -0)
📝 packages/client/src/localization/locales/en.json (+3 -1)
📝 packages/server/src/routes/advanced-memory.routes.ts (+4 -0)
📝 packages/server/src/services/advanced-memory.ts (+81 -36)
📝 scripts/regressions/advanced-memory-summary.regression.ts (+219 -28)

📄 Description

Linked issue

Closes #6461

Why this change

Preparing a long chat could reject a complete scene recap because it exceeded a hidden 1,024-token limit, even though the request fit the configured context. Summary requests also inherited the ordinary Summaries connection and output allowance instead of the Advanced Memory helper. Updating must preserve the summaries already paid for.

The maintainer also requested a confirmed Delete action inside an individual scene-memory editor.

What changed

  • Use the memory helper for scene recaps and continuity. Initial scene detection can still use the main model. Keep the configured memory context ceiling and provider limits.
  • Send standalone historical instructions and the JSON format in the system message, with only eligible source material and applicable corrections in the user message. Preserve custom summary prompts.
  • Treat an individual archive recap's target length as guidance; keep strict limits for constant and temporary summaries inserted into context. Reuse completed scene records and saved detection checkpoints.
  • Add Delete scene memory with confirmation, error recovery, and preservation of original messages. Reuse disabled source identities to prevent regeneration; clear the summary text, vectors, and private generation cache, including the equivalent hidden shared copy.

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 evidence:

  • pnpm check passed, including localization, formatting, types, lint, and production builds.
  • All six Advanced Memory regression files passed; pnpm regression:prompt passed.
  • A local fixture ran the actual 26e2cd0 service, reproduced the old compaction error after 19 completed summaries in a 1,000-message chat, closed storage, and reopened it with this patch. All 19 summaries were unchanged; only the unfinished scene generated again, with no repeated classification.
  • The tracked regression covers helper routing through the Astra Responses adapter, scene-only inputs, context/output limits, strict continuity compaction, disk restart recovery, scoped deletion, preserved source messages, and no automatic regeneration after deletion.
  • All 15 targeted browser cases passed across desktop Chromium, mobile Chromium, and iPhone-sized WebKit (12 on the initial run, then the three scene-editor cases after correcting an ambiguous Scene #1 test selector). The scene editor covers canceling deletion, a failed request, retry, and successful deletion. Light and dark confirmation screenshots were inspected for clipping.
  • A runtime container built from the local production output started successfully and returned HTTP 200 from /api/health.
  • Local CodeRabbit completed with zero findings.

Manual verification notes

Manually verify Resume processing in the affected chat after updating and restarting, without resetting memory. Provider requests and failures were exercised with local fixtures, not a paid model or the maintainer's private chat. Physical iPhone testing remains a maintainer check.

Docs and release impact

Updated docs/agents/memory.md, English UI copy, and CHANGELOG.md. Translation follow-up: #6467. No storage format or release version changes.

  • 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)

🔄 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/6466 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 9/20/2026 **Status:** ✅ Merged **Merged:** 9/20/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `codex/sept20-memory-summary-contract` --- ### 📝 Commits (2) - [`50dcd97`](https://github.com/Pasta-Devs/Marinara-Engine/commit/50dcd975f31f8cb68824d855294ee1b58425cdf9) chore: coordinate memory summary follow-up - [`c5d9dd9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c5d9dd9ae4ec2a990f670d122de8e379920bf884) fix: recover memory preparation and add scene deletion ### 📊 Changes **9 files changed** (+388 additions, -72 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+3 -0) 📝 `docs/agents/memory.md` (+7 -5) 📝 `e2e/advanced-memory.e2e.ts` (+38 -2) 📝 `packages/client/src/components/chat/AdvancedMemoryInspector.tsx` (+30 -0) 📝 `packages/client/src/hooks/use-advanced-memory.ts` (+3 -0) 📝 `packages/client/src/localization/locales/en.json` (+3 -1) 📝 `packages/server/src/routes/advanced-memory.routes.ts` (+4 -0) 📝 `packages/server/src/services/advanced-memory.ts` (+81 -36) 📝 `scripts/regressions/advanced-memory-summary.regression.ts` (+219 -28) </details> ### 📄 Description ## Linked issue Closes #6461 ## Why this change Preparing a long chat could reject a complete scene recap because it exceeded a hidden 1,024-token limit, even though the request fit the configured context. Summary requests also inherited the ordinary Summaries connection and output allowance instead of the Advanced Memory helper. Updating must preserve the summaries already paid for. The maintainer also requested a confirmed Delete action inside an individual scene-memory editor. ## What changed - Use the memory helper for scene recaps and continuity. Initial scene detection can still use the main model. Keep the configured memory context ceiling and provider limits. - Send standalone historical instructions and the JSON format in the system message, with only eligible source material and applicable corrections in the user message. Preserve custom summary prompts. - Treat an individual archive recap's target length as guidance; keep strict limits for constant and temporary summaries inserted into context. Reuse completed scene records and saved detection checkpoints. - Add **Delete scene memory** with confirmation, error recovery, and preservation of original messages. Reuse disabled source identities to prevent regeneration; clear the summary text, vectors, and private generation cache, including the equivalent hidden shared copy. ## 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 evidence: - `pnpm check` passed, including localization, formatting, types, lint, and production builds. - All six Advanced Memory regression files passed; `pnpm regression:prompt` passed. - A local fixture ran the actual `26e2cd0` service, reproduced the old compaction error after 19 completed summaries in a 1,000-message chat, closed storage, and reopened it with this patch. All 19 summaries were unchanged; only the unfinished scene generated again, with no repeated classification. - The tracked regression covers helper routing through the Astra Responses adapter, scene-only inputs, context/output limits, strict continuity compaction, disk restart recovery, scoped deletion, preserved source messages, and no automatic regeneration after deletion. - All 15 targeted browser cases passed across desktop Chromium, mobile Chromium, and iPhone-sized WebKit (12 on the initial run, then the three scene-editor cases after correcting an ambiguous Scene #1 test selector). The scene editor covers canceling deletion, a failed request, retry, and successful deletion. Light and dark confirmation screenshots were inspected for clipping. - A runtime container built from the local production output started successfully and returned HTTP 200 from `/api/health`. - Local CodeRabbit completed with zero findings. ### Manual verification notes Manually verify Resume processing in the affected chat after updating and restarting, without resetting memory. Provider requests and failures were exercised with local fixtures, not a paid model or the maintainer's private chat. Physical iPhone testing remains a maintainer check. ## Docs and release impact Updated `docs/agents/memory.md`, English UI copy, and `CHANGELOG.md`. Translation follow-up: #6467. No storage format or release version changes. - [ ] 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) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:17:22 +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#7190
No description provided.