[PR #7224] [MERGED] fix(memory): give group-chat scenes with no listed participants to every character #7632

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

📋 Pull Request Information

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

Base: staging ← Head: fix/group-missing-audience-all


📝 Commits (3)

  • cf343f7 fix(memory): give group-chat scenes with no listed participants to every character
  • d6a2239 fix(memory): mark scenes with unconfirmed participants in Access memories
  • ac12288 docs(memory): state the missing-audience rule consistently (#7184)

📊 Changes

7 files changed (+117 additions, -43 deletions)

View changed files

📝 CHANGELOG.md (+2 -1)
📝 docs/agents/memory.md (+1 -1)
📝 packages/client/src/components/chat/AdvancedMemoryInspector.tsx (+27 -4)
📝 packages/client/src/localization/locales/en.json (+3 -2)
📝 packages/server/src/services/advanced-memory.ts (+3 -5)
📝 scripts/regressions/advanced-memory-audience.regression.ts (+42 -26)
📝 scripts/regressions/advanced-memory-recall-followups.regression.ts (+39 -4)

📄 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 #7184
Refs #7203

Why this change

Since #7203, a group-chat scene stays narrator-only when the Helper model doesn't say who took part (the audience key is missing or null). The characters who were really there then can't recall it until the user fixes each scene by hand, and in a long group chat that can go unnoticed.

Mari decided on 2026-10-07: "Better to include all characters in that case and allow the user to remove later those to whom it does not apply." A flagged scene shared too widely is easy to fix from the warning, while a scene nobody recalls looks like lost memory.

What changed

  • packages/server/src/services/advanced-memory.ts: a missing or null audience now gives the scene to every chat character, in group chats as well as one-character chats. The existing limits stay: only characters who can access the scene's source messages get it, and the designated narrator, who already sees everything, isn't listed. Group scenes keep the scene-audience-unmatched flag (no audience returned), so the warning still appears. The same code handles new scene summaries, the participant-only pass and the bounded older-scene repair.
  • Not loosened: names that fit no character, names shared with the persona or another character, descriptions such as "sister of Kaito Nakamura", annotated names and non-list shapes such as {"Kaito": false} still grant nothing and are flagged. An explicit [] keeps #7203's meaning: a user-only scene, narrator-only, with no flag.
  • UI copy (en.json): the scene note no longer says the scene is narrator-only. It now says Advanced Memory couldn't confirm who was in the scene and points to Edit character access. The settings warning now says those scenes are marked in Access memories for this chat. No community UI pack translates these keys yet.
  • AdvancedMemoryInspector.tsx: the scene list marks flagged scenes with "Check who was there" (new key chat.advancedMemory.audienceUnconfirmed, steady accent colour), and searching for that text finds them. Before this PR, the "Narrator only" label was the only clue in the list. Now these scenes list every character, the same as a confirmed scene, so without the marker the user would have to open each scene to find them.
  • Regressions:
    • advanced-memory-audience.regression.ts: the group assertion now expects every character, with a comment citing Mari's decision. The maintainer decision changed; the test is not weakened. New assertions check the scene's flag (no audience returned), that an unknown name is flagged with that name, and that matched names and "all" are not flagged. Pantalone's recall checks now pin the exact scene set: the unlisted scene and the "all" scene, never the scene where Maukie only talked about him.
    • advanced-memory-recall-followups.regression.ts: group cases for a missing audience, null, [], {"Kaito": false} and a description. Every matrix case now also runs through the older-scene participant check and must give the same access and warning.
    • The same matrix also pins three more things:
      • A character hidden from every message of the scene doesn't get it. Removing that source check makes the regression fail.
      • In a one-character chat, a missing or null audience still goes to that character, with no warning.
      • After Edit character access removes a character, the warning clears, and the change survives a later Prepare existing history without another participant check.
  • docs/agents/memory.md and CHANGELOG.md ([Unreleased]).

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

What the agent ran (the boxes above are left for a human):

  • node scripts/run-regressions.mjs --filter memory: 20/20 passed (after the verifier's follow-up commit too).
  • With advanced-memory.ts from origin/staging, both changed regressions fail on the new group assertions.
  • pnpm check and pnpm localization:check: passed.
  • A second local CodeRabbit run on the follow-up commit was rate limited and was not retried.
  • Local CodeRabbit (CLI 0.8.2, one run) raised 2 findings. Neither led to a change:
    1. Flag a missing audience against the full roster, narrator included. With one character plus a designated narrator, the scene goes to that character without a flag. That is #7203's one-character rule, which this PR doesn't change. The narrator always has access, so the warning would leave nothing to choose.
    2. Migrate existing narrator-only scenes flagged no audience returned. Such scenes exist only on staging builds made after #7203, which hasn't reached main or a release. They keep their warning, the new copy describes them correctly, and Edit character access fixes them. A migration or forced re-check would add code and paid helper calls for that short staging-only window.

Manual verification notes

  • Manually verify in a Roleplay group chat with two characters and Advanced Memory on, using a Helper model (or fake provider) whose summary answer has no audience: after Prepare existing history, Access memories for this chat lists both characters for that scene.
  • Manually verify that the Advanced Memory settings then show "Advanced Memory couldn't confirm who was in some scenes. They're marked in Access memories for this chat."
  • Manually verify that the scene's row in Access memories for this chat ends its character line with "Check who was there" in the accent colour, which stays steady with Accent Pulse on, and that typing "check" in the scene search finds it.
  • Manually verify that opening the scene shows "Advanced Memory couldn't confirm who was in this scene. Check who was there in Edit character access, then save."
  • Manually verify that removing one character in Edit character access and saving clears the warning and the row marker, that the character no longer recalls the scene, and that Prepare existing history afterwards doesn't add them back.
  • Manually verify that saving Edit character access without changes, when everyone really was there, also clears the warning.
  • Manually verify that a one-character chat with a missing audience still gives the scene to that character with no warning.
  • Manually verify that a group scene whose answer names only a stranger stays narrator-only with the warning.

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)

Changed: docs/agents/memory.md (participant paragraph) and CHANGELOG.md ([Unreleased]). Translation follow-up: #7225. No version or storage-format change.

UI evidence (if applicable)

One short marker, "Check who was there", added to the scene row's character line in Access memories for this chat. Two existing English strings were reworded.

Summary by CodeRabbit

  • New Features

    • In group chats, scenes with no identified participants are now available to all characters, while remaining flagged for access review. Scenes naming no recognized character can still be assigned access manually.
  • Documentation

    • Clarified how missing or unrecognized participants affect scene access, including the narrator-only behavior for scenes involving only the user.
  • Bug Fixes

    • Updated Advanced Memory Recall messages to guide users to review and save scene access without implying that unmatched audiences are narrator-only.

🔄 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/7224 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/7/2026 **Status:** ✅ Merged **Merged:** 10/7/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/group-missing-audience-all` --- ### 📝 Commits (3) - [`cf343f7`](https://github.com/Pasta-Devs/Marinara-Engine/commit/cf343f73e0288d9cf06c59a59b63432509f55609) fix(memory): give group-chat scenes with no listed participants to every character - [`d6a2239`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d6a2239ab2e1d7cb65a6561bd84264479ef4c7ef) fix(memory): mark scenes with unconfirmed participants in Access memories - [`ac12288`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ac122888b9e8860f2c289fc43ebf44f99e4bd108) docs(memory): state the missing-audience rule consistently (#7184) ### 📊 Changes **7 files changed** (+117 additions, -43 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+2 -1) 📝 `docs/agents/memory.md` (+1 -1) 📝 `packages/client/src/components/chat/AdvancedMemoryInspector.tsx` (+27 -4) 📝 `packages/client/src/localization/locales/en.json` (+3 -2) 📝 `packages/server/src/services/advanced-memory.ts` (+3 -5) 📝 `scripts/regressions/advanced-memory-audience.regression.ts` (+42 -26) 📝 `scripts/regressions/advanced-memory-recall-followups.regression.ts` (+39 -4) </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`. <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue Refs #7184 Refs #7203 ## Why this change Since #7203, a group-chat scene stays narrator-only when the Helper model doesn't say who took part (the `audience` key is missing or `null`). The characters who were really there then can't recall it until the user fixes each scene by hand, and in a long group chat that can go unnoticed. Mari decided on 2026-10-07: "Better to include all characters in that case and allow the user to remove later those to whom it does not apply." A flagged scene shared too widely is easy to fix from the warning, while a scene nobody recalls looks like lost memory. ## What changed - `packages/server/src/services/advanced-memory.ts`: a missing or `null` audience now gives the scene to every chat character, in group chats as well as one-character chats. The existing limits stay: only characters who can access the scene's source messages get it, and the designated narrator, who already sees everything, isn't listed. Group scenes keep the `scene-audience-unmatched` flag (`no audience returned`), so the warning still appears. The same code handles new scene summaries, the participant-only pass and the bounded older-scene repair. - Not loosened: names that fit no character, names shared with the persona or another character, descriptions such as "sister of Kaito Nakamura", annotated names and non-list shapes such as `{"Kaito": false}` still grant nothing and are flagged. An explicit `[]` keeps #7203's meaning: a user-only scene, narrator-only, with no flag. - UI copy (`en.json`): the scene note no longer says the scene is narrator-only. It now says Advanced Memory couldn't confirm who was in the scene and points to **Edit character access**. The settings warning now says those scenes are marked in **Access memories for this chat**. No community UI pack translates these keys yet. - `AdvancedMemoryInspector.tsx`: the scene list marks flagged scenes with "Check who was there" (new key `chat.advancedMemory.audienceUnconfirmed`, steady accent colour), and searching for that text finds them. Before this PR, the "Narrator only" label was the only clue in the list. Now these scenes list every character, the same as a confirmed scene, so without the marker the user would have to open each scene to find them. - Regressions: - `advanced-memory-audience.regression.ts`: the group assertion now expects every character, with a comment citing Mari's decision. The maintainer decision changed; the test is not weakened. New assertions check the scene's flag (`no audience returned`), that an unknown name is flagged with that name, and that matched names and `"all"` are not flagged. Pantalone's recall checks now pin the exact scene set: the unlisted scene and the `"all"` scene, never the scene where Maukie only talked about him. - `advanced-memory-recall-followups.regression.ts`: group cases for a missing audience, `null`, `[]`, `{"Kaito": false}` and a description. Every matrix case now also runs through the older-scene participant check and must give the same access and warning. - The same matrix also pins three more things: - A character hidden from every message of the scene doesn't get it. Removing that source check makes the regression fail. - In a one-character chat, a missing or `null` audience still goes to that character, with no warning. - After **Edit character access** removes a character, the warning clears, and the change survives a later **Prepare existing history** without another participant check. - `docs/agents/memory.md` and `CHANGELOG.md` (`[Unreleased]`). ## 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` What the agent ran (the boxes above are left for a human): - `node scripts/run-regressions.mjs --filter memory`: 20/20 passed (after the verifier's follow-up commit too). - With `advanced-memory.ts` from `origin/staging`, both changed regressions fail on the new group assertions. - `pnpm check` and `pnpm localization:check`: passed. - A second local CodeRabbit run on the follow-up commit was rate limited and was not retried. - Local CodeRabbit (CLI 0.8.2, one run) raised 2 findings. Neither led to a change: 1. *Flag a missing audience against the full roster, narrator included.* With one character plus a designated narrator, the scene goes to that character without a flag. That is #7203's one-character rule, which this PR doesn't change. The narrator always has access, so the warning would leave nothing to choose. 2. *Migrate existing narrator-only scenes flagged `no audience returned`.* Such scenes exist only on staging builds made after #7203, which hasn't reached `main` or a release. They keep their warning, the new copy describes them correctly, and **Edit character access** fixes them. A migration or forced re-check would add code and paid helper calls for that short staging-only window. ### Manual verification notes - Manually verify in a Roleplay group chat with two characters and Advanced Memory on, using a Helper model (or fake provider) whose summary answer has no `audience`: after **Prepare existing history**, **Access memories for this chat** lists both characters for that scene. - Manually verify that the Advanced Memory settings then show "Advanced Memory couldn't confirm who was in some scenes. They're marked in Access memories for this chat." - Manually verify that the scene's row in **Access memories for this chat** ends its character line with "Check who was there" in the accent colour, which stays steady with Accent Pulse on, and that typing "check" in the scene search finds it. - Manually verify that opening the scene shows "Advanced Memory couldn't confirm who was in this scene. Check who was there in Edit character access, then save." - Manually verify that removing one character in **Edit character access** and saving clears the warning and the row marker, that the character no longer recalls the scene, and that **Prepare existing history** afterwards doesn't add them back. - Manually verify that saving **Edit character access** without changes, when everyone really was there, also clears the warning. - Manually verify that a one-character chat with a missing audience still gives the scene to that character with no warning. - Manually verify that a group scene whose answer names only a stranger stays narrator-only with the warning. ## 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) Changed: `docs/agents/memory.md` (participant paragraph) and `CHANGELOG.md` (`[Unreleased]`). Translation follow-up: #7225. No version or storage-format change. ## UI evidence (if applicable) One short marker, "Check who was there", added to the scene row's character line in **Access memories for this chat**. Two existing English strings were reworded. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * In group chats, scenes with no identified participants are now available to all characters, while remaining flagged for access review. Scenes naming no recognized character can still be assigned access manually. * **Documentation** * Clarified how missing or unrecognized participants affect scene access, including the narrator-only behavior for scenes involving only the user. * **Bug Fixes** * Updated Advanced Memory Recall messages to guide users to review and save scene access without implying that unmatched audiences are narrator-only. <!-- 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:01 +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#7632
No description provided.