[PR #6462] [MERGED] fix: resume stalled advanced memory summaries #7188

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

📋 Pull Request Information

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

Base: staging ← Head: codex/sept20-memory-resume


📝 Commits (2)

  • ebbf585 docs: track advanced memory summary recovery
  • c2882e8 fix: retry stalled memory compaction from saved progress

📊 Changes

3 files changed (+115 additions, -9 deletions)

View changed files

📝 CHANGELOG.md (+2 -0)
📝 packages/server/src/services/advanced-memory.ts (+35 -9)
📝 scripts/regressions/advanced-memory-summary.regression.ts (+78 -0)

📄 Description

Linked issue

Closes #6461

Why this change

When a scene recap exceeded its summary budget, Resume processing could reuse the same failed compaction and immediately show the same error again. Preparation also announced scene classification even when its durable checkpoint skipped that work. A large model context window did not prevent this because retained memory has its own smaller limit.

What changed

  • Resume retains completed scenes, source-summary batches, and boundary checkpoints, but retries the compaction pass that failed to fit. Old oversized cached compactions cannot permanently trap the job.
  • Subsequent compaction requests explicitly ask the model to shorten its recap. Progress is measured in estimated tokens, and the error names the memory-summary limit. Responses are never silently truncated or accepted over budget.
  • Initialization reports summarizing/indexing when boundary detection is already complete. Scene inputs, ranged summary corrections, and audience restrictions are unchanged.

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 verification completed:

  • pnpm check passes (one existing unrelated GameNarration hook warning).
  • All six Advanced Memory Node regression files pass, including full-history preparation, audience limits, persisted cancellation checkpoints, ranged corrections, source races, context fit, and real generation routes.
  • The new failure test uses the actual Astra Responses adapter, file-backed storage, a synthetic provider, and a 65,000-token context. It failed before the fix. One scene completes, a later recap repeatedly exceeds 512 tokens, then the real Resume HTTP endpoint finishes with exactly one new compaction call. Boundary detection and the completed scene are not regenerated; future-scene text is absent from earlier summaries. Over-budget text remains private unfinished work.
  • pnpm regression:prompt passes.
  • Local CodeRabbit review completed with zero findings.
  • A local runtime container built from the compiled artifacts on the existing identical-dependency production base and returned healthy /api/health. The required GitHub container check performs the full source build.

Manual verification notes

No physical iPhone or live paid model run is claimed. Manually verify Resume processing in the affected chat after updating; resetting memory should not be necessary. Existing UI layout is unchanged, and server progress is covered through the real HTTP endpoint.

Docs and release impact

Added an Unreleased changelog entry. No dependency, schema, release metadata, or user-facing documentation changes.

UI evidence (if applicable)

No new UI surface. The existing progress panel consumes the corrected server stage and error.


🔄 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/6462 **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-resume` --- ### 📝 Commits (2) - [`ebbf585`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ebbf58515ad8f1f0e46cf77a77bef6f932901604) docs: track advanced memory summary recovery - [`c2882e8`](https://github.com/Pasta-Devs/Marinara-Engine/commit/c2882e8c676ec6e2890c05853268432d3e6d998d) fix: retry stalled memory compaction from saved progress ### 📊 Changes **3 files changed** (+115 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+2 -0) 📝 `packages/server/src/services/advanced-memory.ts` (+35 -9) 📝 `scripts/regressions/advanced-memory-summary.regression.ts` (+78 -0) </details> ### 📄 Description ## Linked issue Closes #6461 ## Why this change When a scene recap exceeded its summary budget, Resume processing could reuse the same failed compaction and immediately show the same error again. Preparation also announced scene classification even when its durable checkpoint skipped that work. A large model context window did not prevent this because retained memory has its own smaller limit. ## What changed - Resume retains completed scenes, source-summary batches, and boundary checkpoints, but retries the compaction pass that failed to fit. Old oversized cached compactions cannot permanently trap the job. - Subsequent compaction requests explicitly ask the model to shorten its recap. Progress is measured in estimated tokens, and the error names the memory-summary limit. Responses are never silently truncated or accepted over budget. - Initialization reports summarizing/indexing when boundary detection is already complete. Scene inputs, ranged summary corrections, and audience restrictions are unchanged. ## 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 verification completed: - `pnpm check` passes (one existing unrelated GameNarration hook warning). - All six Advanced Memory Node regression files pass, including full-history preparation, audience limits, persisted cancellation checkpoints, ranged corrections, source races, context fit, and real generation routes. - The new failure test uses the actual Astra Responses adapter, file-backed storage, a synthetic provider, and a 65,000-token context. It failed before the fix. One scene completes, a later recap repeatedly exceeds 512 tokens, then the real Resume HTTP endpoint finishes with exactly one new compaction call. Boundary detection and the completed scene are not regenerated; future-scene text is absent from earlier summaries. Over-budget text remains private unfinished work. - `pnpm regression:prompt` passes. - Local CodeRabbit review completed with zero findings. - A local runtime container built from the compiled artifacts on the existing identical-dependency production base and returned healthy `/api/health`. The required GitHub container check performs the full source build. ### Manual verification notes No physical iPhone or live paid model run is claimed. Manually verify Resume processing in the affected chat after updating; resetting memory should not be necessary. Existing UI layout is unchanged, and server progress is covered through the real HTTP endpoint. ## Docs and release impact Added an Unreleased changelog entry. No dependency, schema, release metadata, or user-facing documentation changes. ## UI evidence (if applicable) No new UI surface. The existing progress panel consumes the corrected server stage and error. --- <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:21 +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#7188
No description provided.