[PR #7377] [MERGED] fix(memory): restore scene-check guards and suites broken by #7373 #7706

Closed
opened 2026-10-24 04:06:42 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

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

Base: staging ← Head: fix/memory-scene-regressions


📝 Commits (1)

  • 43bda6d fix(memory): restore scene-check guards and suites broken by #7373

📊 Changes

5 files changed (+13 additions, -16 deletions)

View changed files

📝 packages/server/src/services/advanced-memory-decisions.ts (+1 -2)
📝 packages/server/src/services/advanced-memory.ts (+10 -7)
📝 scripts/regressions/advanced-memory-decisions.regression.ts (+0 -5)
📝 scripts/regressions/advanced-memory-local-decision.regression.ts (+1 -1)
📝 scripts/regressions/advanced-memory-recall-shortlist.regression.ts (+1 -1)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Refs #7371. This fixes four regressions that #7373 introduced.

Why this change

#7373 was merged while its complete-node-regressions job was failing. Before handing it over, I had run only the two memory suites I had edited. Four other Advanced Memory suites now fail on staging:

Suite Failure Cause
advanced-memory-core "tracker output cannot use an ID omitted from its character-scoped payload" Real gap. #7373 accepted any checked number or the one before it, so a tracker could end a scene on a message that was left out of its payload.
advanced-memory-visibility "the scene-end question is asked" #7373 skipped a candidate with nothing before it. A chat's first message was then never asked, so presence questions could not ride along with the scene question.
advanced-memory-local-decision, advanced-memory-recall-shortlist scenes never close Their mocks matched the old clearly START wording.

What changed

  • commitSceneCheckImpl accepts an ending only on a checked message, or on the message just before the checked window (the seam #7373 opened for the Decision model). A message left out of the request is rejected again.
  • The Decision path ends a scene on the preceding checked message, or on the message before the window for the first one. So a command or system message between two checked messages can no longer become the ending.
  • The first-message skip in detectDecisionSceneStarts is reverted. Both adversarial verifiers on #7373 had found it unnecessary, since a start at the first message is a no-op.
  • Two suite mocks now match the new cut to a new scene question.

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: all 22 advanced-memory-*, decision-*, lorebook-decision-activation and smart-group-decision suites pass locally, including the four above. A full local run-regressions pass is in progress; its result will be posted here.

Manual verification notes

  • Manually verify a Decision-model Roleplay reply where the first new message moves to another place: the scene ends on the last message of the previous check.

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)

There is no CHANGELOG entry: this restores the behaviour #7373's entry already describes.

Summary by CodeRabbit

  • Bug Fixes
    • Scene detection can now identify a new scene starting with the first message in a conversation or the first message in a checked segment.
    • Scene boundaries are handled more accurately when a check begins partway through a conversation, including when the preceding message is outside the checked segment.
    • This improves scene-based memory and recall for conversations where a scene change occurs at the start of the available messages.

🔄 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/7377 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/9/2026 **Status:** ✅ Merged **Merged:** 10/9/2026 **Merged by:** [@undefined](undefined) **Base:** `staging` ← **Head:** `fix/memory-scene-regressions` --- ### 📝 Commits (1) - [`43bda6d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/43bda6d0c247dda524cf030ee56960aad6ee0c0a) fix(memory): restore scene-check guards and suites broken by #7373 ### 📊 Changes **5 files changed** (+13 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/services/advanced-memory-decisions.ts` (+1 -2) 📝 `packages/server/src/services/advanced-memory.ts` (+10 -7) 📝 `scripts/regressions/advanced-memory-decisions.regression.ts` (+0 -5) 📝 `scripts/regressions/advanced-memory-local-decision.regression.ts` (+1 -1) 📝 `scripts/regressions/advanced-memory-recall-shortlist.regression.ts` (+1 -1) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Refs #7371. This fixes four regressions that #7373 introduced. ## Why this change #7373 was merged while its `complete-node-regressions` job was failing. Before handing it over, I had run only the two memory suites I had edited. Four other Advanced Memory suites now fail on `staging`: | Suite | Failure | Cause | |---|---|---| | `advanced-memory-core` | "tracker output cannot use an ID omitted from its character-scoped payload" | **Real gap.** #7373 accepted any checked number *or the one before it*, so a tracker could end a scene on a message that was left out of its payload. | | `advanced-memory-visibility` | "the scene-end question is asked" | #7373 skipped a candidate with nothing before it. A chat's first message was then never asked, so presence questions could not ride along with the scene question. | | `advanced-memory-local-decision`, `advanced-memory-recall-shortlist` | scenes never close | Their mocks matched the old `clearly START` wording. | ## What changed - `commitSceneCheckImpl` accepts an ending only on a checked message, or on the message just before the checked window (the seam #7373 opened for the Decision model). A message left out of the request is rejected again. - The Decision path ends a scene on the **preceding checked message**, or on the message before the window for the first one. So a command or system message between two checked messages can no longer become the ending. - The first-message skip in `detectDecisionSceneStarts` is reverted. Both adversarial verifiers on #7373 had found it unnecessary, since a start at the first message is a no-op. - Two suite mocks now match the new `cut to a new scene` question. ## 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: all 22 `advanced-memory-*`, `decision-*`, `lorebook-decision-activation` and `smart-group-decision` suites pass locally, including the four above. A full local `run-regressions` pass is in progress; its result will be posted here. ### Manual verification notes - Manually verify a Decision-model Roleplay reply where the first new message moves to another place: the scene ends on the last message of the previous check. ## Docs and release impact - [x] 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) There is no CHANGELOG entry: this restores the behaviour #7373's entry already describes. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Scene detection can now identify a new scene starting with the first message in a conversation or the first message in a checked segment. * Scene boundaries are handled more accurately when a check begins partway through a conversation, including when the preceding message is outside the checked segment. * This improves scene-based memory and recall for conversations where a scene change occurs at the start of the available messages. <!-- 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-24 04:06:42 +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#7706
No description provided.