[PR #7199] [MERGED] feat(memory): let Advanced Memory decide who sees new messages in group chats #7621

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

📋 Pull Request Information

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

Base: staging ← Head: feat/auto-message-visibility-7192


📝 Commits (10+)

  • 4a26df4 feat(memory): let Advanced Memory decide who sees new messages in group chats
  • 9aeae74 test(memory): capture the visibility switch in light and dark themes
  • d613f1e fix(memory): keep Jev scene checks when shared presence answers fail
  • fd9f64c Merge remote-tracking branch 'origin/staging' into feat/auto-message-visibility-7192
  • 95056b4 docs(memory): keep the visibility note apart from Hide from AI's chooser text
  • 16e7dcb Merge remote-tracking branch 'origin/staging' into feat/auto-message-visibility-7192
  • 5d7d04d docs(memory): name the Roleplay Commands narrator by its label
  • ac42fd8 fix(memory): keep /unhide choices and scene checks safe from automatic visibility
  • 2d1e443 fix(memory): retry the scene check alone only for an unusable shared answer
  • 49b0ee9 Merge remote-tracking branch 'origin/staging' into feat/auto-message-visibility-7192

📊 Changes

14 files changed (+1102 additions, -98 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 docs/agents/memory.md (+12 -0)
📝 docs/chats/messages.md (+2 -0)
📝 e2e/advanced-memory.e2e.ts (+62 -0)
📝 packages/client/src/components/chat/AdvancedMemorySettings.tsx (+12 -0)
📝 packages/client/src/localization/locales/en.json (+2 -0)
📝 packages/server/src/routes/chats.routes.ts (+11 -1)
📝 packages/server/src/routes/generate.routes.ts (+33 -2)
📝 packages/server/src/services/advanced-memory-decisions.ts (+58 -9)
📝 packages/server/src/services/advanced-memory.ts (+446 -83)
📝 packages/server/src/services/storage/chats.storage.ts (+11 -3)
📝 packages/shared/src/types/advanced-memory.ts (+2 -0)
📝 packages/shared/src/types/chat.ts (+4 -0)
➕ scripts/regressions/advanced-memory-visibility.regression.ts (+446 -0)

📄 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

Closes #7192

Why this change

  • In Roleplay group chats where characters reply one by one, a character who is away (for example Pantalone) still reads every message unless the user hides each line by hand with Hide from AI. That is tedious and easy to forget, and a forgotten line leaks the scene to someone who wasn't there.
  • Advanced Memory already reads the recent scene for its scene-end check, so it can also decide who is present and apply the existing per-character hide automatically. The model can be wrong, so the user's own change must always win, and a failure must hide nothing.

What changed

  • Setting: new autoMessageVisibility in Advanced Memory settings (default off; older saved settings stay valid). The Decide who sees new messages switch appears only in Roleplay group chats in individual mode; the server ignores it in merged mode and one-character chats. It is excluded from the preparation policy hash, so turning it on or off doesn't invalidate saved memory snapshots.
  • Who decides: with Use Decision model on, the Decision model answers one presence question per character and message ("present and able to see or hear it, even without speaking?"), present = score at or above the backend's calibrated threshold. When a scene-end check runs, these questions ride in the same askMixed request if they fit the batch and state limits; otherwise they go in their own request. If the shared request's presence answers are unusable, the scene-end questions are retried alone, so the scene check never falls back to the helper because of presence. Without a Decision model, the Advanced Memory helper answers inside its due scene-check call ({"ends":[...],"visibility":[...]}), or in a separate call when no scene check is due or the check was batched with a tracker. If that shared answer comes back cut off, incomplete or without usable ends, the scene check is asked again on its own (nothing is hidden for those messages); a connection error is not retried, so a broken helper isn't waited on twice. Helper names are mapped case-insensitively with a unique first-name fallback; omitted or unknown names hide nothing.
  • Hint, not decisive: the model also receives the characters who sent a message since the current scene started (Advanced Memory's saved scene boundary, or a bounded recent window).
  • Applying: decisions are written through the existing hiddenFromAICharacterIds on the message and all swipes, so the normal crossed-eye marker shows them. extra.autoVisibility records the decision; each message is decided once. The existing message-extra route marks any user change to hiddenFromAICharacterIds as visibilityManual, and so does the bulk-hidden route behind /hide and /unhide; automation never touches such a message, nor one that already had a hide, nor a message hidden from all. Both keys survive new swipes.
  • Never hidden from: the Advanced Memory narrator, the roleplay-command narrator, the message's author, and a whisper's recipient. The whisper-recipient exclusion is a marked ponytail: shortcut: on staging today a hidden message drops its whispers, so this keeps whispers working regardless of merge order. Once #7196 (#7191) lands, it can be removed so an absent recipient gets only the whisper. The #7191 whisper logic itself is untouched.
  • Ordering: a per-chat visibility lock (separate from the long-running memory queue) covers deciding and applying. /generate settles undecided recent messages (last 8, 20-second limit) before loading history, and again between replies of the same individual-mode turn, so no character generates before earlier messages are decided. The post-reply check decides the turn's last reply before any scene summary starts.
  • Fail-open: errors, timeouts and unusable answers hide nothing, are logged with the Pino logger, and mark the message decided so a broken connection doesn't delay every turn. Toggle off makes no extra calls.
  • Debug logging: helper prompts go through the shared askHelperJson with logDebugOverride (debugMode / DEBUG_AGENTS); Decision requests use the backend's existing debug logging, plus a debug line with the decided hides.
  • Refactor: the post-generation scene check's helper request now uses the extracted helperBudget / askHelperJson helpers (same prompts, limits, errors and debug text).
  • Docs: docs/agents/memory.md (new Deciding who sees new messages section), docs/chats/messages.md (Hide from AI). CHANGELOG entry added. Translations: #7202.

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

Agent-run checks (not a substitute for the boxes above):

  • pnpm check stages: impeccable, localization, format, lint, e2e types, token-estimation types and build all pass.
  • New scripts/regressions/advanced-memory-visibility.regression.ts (fake helper + fake Decision backend; narrator, Maukie present, Pantalone away, persona P): hides from Pantalone only; never the narrator or author; first-name and upper-case helper answers map correctly; swipes stay in sync; decided messages are not asked again; manual changes before and after automation persist; a pre-existing hide is left alone; a failed call hides nothing; toggle off, merged mode and one-character chats make no call; the helper answers presence inside a due scene check; the Decision model gets presence and scene-end questions in one request, or presence alone when no check is due; through /generate, visibility settles before each character in the turn and Pantalone's prompt lacks the earlier lines while the narrator's has them. Mutation-checked: removing either route guard fails the regression.
  • The regression also covers a whisper recipient never being a candidate, and a shared Decision request with unusable presence answers retrying the scene check alone (mutation-checked).
  • New e2e in e2e/advanced-memory.e2e.ts: the switch shows and saves in an individual group chat, and is absent in merged mode and in a one-character chat. Passed on desktop-chromium and mobile-chromium; the existing Decision-connection e2e next to it still passes.
  • Existing regressions rerun and passing: all 12 advanced-memory-*, slash-command-usage, regeneration-context, roleplay-whisper-generation, prompt*, past-reasoning-history, prompt-controls, decision-conditionals, smart-group-decision.

Local CodeRabbit review (first pass, 3 findings):

  • Fixed: missing presence scores no longer rely on a non-null assertion; a missing score keeps the character.
  • Fixed: a shared Decision request with unusable presence answers now retries the scene-end questions alone (regression added).
  • Not changed, by design: "don't record failed decisions, retry later". A failed decision is still recorded with nothing hidden. Retrying would make every later turn wait on a broken connection again, and the between-replies guard could then change a source message of a reply in progress, which fails that reply's memory check ("Chat history changed before generation"). The user can still hide the message by hand. This is commented in withVisibility.

Adversarial verification pass (separate agent, commits ac42fd87a, 2d1e4437d, staging merge 49b0ee997):

  • Found and fixed: /hide then /unhide (the bulk-hidden route) didn't count as the user's choice, so automation could later hide a message the user had just restored for everyone. The route now saves visibilityManual like the Hide from AI button (bulkSetHiddenFromAI takes optional extra fields; automatic summary hides are unchanged).
  • Found and fixed: with the helper (no Decision model), a shared scene-and-presence answer without usable ends failed the whole scene check ("The scene helper returned an invalid scene decision"), so turning the switch on could break a scene check that would otherwise pass. It now retries the scene check alone, matching the Decision path. A connection error still fails as before.
  • Regression extended for both (mutation-checked: reverting either fix fails it). The PR's existing assertions are unchanged.
  • Probed without new code changes, all as intended: both narrators and the author are never hidden even when the model says they're absent; ambiguous first names and garbage helper replies hide nothing; content edits, swipes (POST …/swipes and /generate regenerate) keep the decision and the manual flag; regenerations make no new visibility call; paused memory, Conversation mode, merged and one-character chats make no call; Stop during the start-of-generation check writes nothing and ends cleanly; a hung helper times out at 20 s and the reply goes ahead with nothing hidden; prompt preview (/generate/dryRun) stays read-only and never decides visibility.
  • Rerun on the final head: pnpm check passes (including localization:check), pnpm regression:prompt passes, all 13 advanced-memory-* regressions plus roleplay-whisper-generation, roleplay-commands, slash-command-usage, regeneration-context, command-only-regenerate, roleplay-interrupt-generation, chat-story-export, past-reasoning-history, prompt-controls, decision-conditionals, smart-group-decision, spatial-only-message-visibility and issue-sweep-5391-5394 pass. The visibility e2e and the Decision-connection e2e pass on desktop-chromium and mobile-chromium (the Decision-connection e2e timed out once while the machine was loaded and passed on both reruns).

Local CodeRabbit on the final head (after two rate-limit waits), 3 findings, none changed:

  • Not changed: "restore earlier visibilityManual values when bulkSetHiddenFromAI rolls back". A rollback can leave visibilityManual on some rows the user tried to change; that only stops automation for those messages, so they stay visible to every character (the same result as a failed decision). The method's all-or-nothing contract covers hiddenFromAI, which callers record as ownership, and that is still restored.
  • Not changed, by design (same as the earlier declined finding): "leave plan.asked false after an unusable shared answer so visibility gets its own call". Each message is decided once and a failure hides nothing; a third call would hold the next reply longer.
  • Not changed: "drop globally hidden replies from the running prompt between replies". Nothing automatic sets hiddenFromAI, and the refresh only applies automatic per-character results; a user hiding a reply for everyone in the middle of a turn behaves exactly as on staging (and with the switch off). Changing that is a separate behavior change.

Manual verification notes

  • Manually verify in a Roleplay group chat set to individual replies: open Chat Settings → Memory Recall → Advanced Memory Recall, choose a Narrator, and turn on Decide who sees new messages. Send a message while one character is clearly elsewhere; confirm the crossed-eye marker on the new messages shows only the absent character, never the narrator or the speaker.
  • Manually verify that the next character's reply doesn't mention what the absent character couldn't know, and that the absent character's own turn (if it replies) doesn't see those lines.
  • Manually verify a manual change wins: unhide an automatically hidden message from its Hide from AI chooser, send more messages, and confirm that message stays unhidden. Repeat with /hide N then /unhide N on a new message before the next reply, and confirm no character is hidden from it afterwards.
  • Manually verify with Use Decision model on (a Jev connection) and again with it off (helper only), with Debug mode on: the server log shows the presence questions or the visibility prompt, and with a due scene check only one helper request is made.
  • Manually verify the switch is absent in a merged group chat and a one-character Roleplay chat, in light and dark mode and at phone width.
  • Manually verify a broken helper connection hides nothing and the chat still replies (expect up to about 20 seconds of extra wait before each reply while it times out).

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)

Docs touched: docs/agents/memory.md, docs/chats/messages.md, CHANGELOG.md.

UI evidence (if applicable)

New switch under Narrator in Advanced Memory settings. The new e2e saves memory-message-visibility-on-light.png and -dark.png in its test output.

Summary by CodeRabbit

  • New Features
    • Advanced Memory can automatically hide new messages from characters who are not present in the scene in group chats where characters reply one at a time. The option is off by default and unavailable in merged group chats and solo chats.
    • The narrator, message author, and whisper recipient retain access. Manual Hide from AI choices are preserved. If visibility cannot be determined, the message remains visible to all characters.
  • Documentation
    • Updated the Advanced Memory and message visibility guides with details about the setting and how it works.

🔄 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/7199 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/6/2026 **Status:** ✅ Merged **Merged:** 10/7/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `feat/auto-message-visibility-7192` --- ### 📝 Commits (10+) - [`4a26df4`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4a26df4206afe81febeec6da9f03390be7b931d8) feat(memory): let Advanced Memory decide who sees new messages in group chats - [`9aeae74`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9aeae74f428346cbd030f25557af9f7c097a9ece) test(memory): capture the visibility switch in light and dark themes - [`d613f1e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d613f1e58668c060dc974391414f3dee5fdfa925) fix(memory): keep Jev scene checks when shared presence answers fail - [`fd9f64c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/fd9f64c2cc8d4d52b083db26cc2e7badc5492611) Merge remote-tracking branch 'origin/staging' into feat/auto-message-visibility-7192 - [`95056b4`](https://github.com/Pasta-Devs/Marinara-Engine/commit/95056b4b91e56d31d15a3d2fce10870485d43343) docs(memory): keep the visibility note apart from Hide from AI's chooser text - [`16e7dcb`](https://github.com/Pasta-Devs/Marinara-Engine/commit/16e7dcb2f5512b1636f16cc13c7f6ef8a1e66cab) Merge remote-tracking branch 'origin/staging' into feat/auto-message-visibility-7192 - [`5d7d04d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5d7d04d5f652124b7ff4f5839c8c6bd5eac3fff7) docs(memory): name the Roleplay Commands narrator by its label - [`ac42fd8`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ac42fd87a4fb1dfbdcd7b03e8bc61a7a277c3d47) fix(memory): keep /unhide choices and scene checks safe from automatic visibility - [`2d1e443`](https://github.com/Pasta-Devs/Marinara-Engine/commit/2d1e4437d9ca585483da8747c56baee9749264d9) fix(memory): retry the scene check alone only for an unusable shared answer - [`49b0ee9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/49b0ee997695fc358dffe3d2e80c23626399ba63) Merge remote-tracking branch 'origin/staging' into feat/auto-message-visibility-7192 ### 📊 Changes **14 files changed** (+1102 additions, -98 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `docs/agents/memory.md` (+12 -0) 📝 `docs/chats/messages.md` (+2 -0) 📝 `e2e/advanced-memory.e2e.ts` (+62 -0) 📝 `packages/client/src/components/chat/AdvancedMemorySettings.tsx` (+12 -0) 📝 `packages/client/src/localization/locales/en.json` (+2 -0) 📝 `packages/server/src/routes/chats.routes.ts` (+11 -1) 📝 `packages/server/src/routes/generate.routes.ts` (+33 -2) 📝 `packages/server/src/services/advanced-memory-decisions.ts` (+58 -9) 📝 `packages/server/src/services/advanced-memory.ts` (+446 -83) 📝 `packages/server/src/services/storage/chats.storage.ts` (+11 -3) 📝 `packages/shared/src/types/advanced-memory.ts` (+2 -0) 📝 `packages/shared/src/types/chat.ts` (+4 -0) ➕ `scripts/regressions/advanced-memory-visibility.regression.ts` (+446 -0) </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 Closes #7192 ## Why this change - In Roleplay group chats where characters reply one by one, a character who is away (for example Pantalone) still reads every message unless the user hides each line by hand with **Hide from AI**. That is tedious and easy to forget, and a forgotten line leaks the scene to someone who wasn't there. - Advanced Memory already reads the recent scene for its scene-end check, so it can also decide who is present and apply the existing per-character hide automatically. The model can be wrong, so the user's own change must always win, and a failure must hide nothing. ## What changed - **Setting:** new `autoMessageVisibility` in Advanced Memory settings (default off; older saved settings stay valid). The **Decide who sees new messages** switch appears only in Roleplay group chats in individual mode; the server ignores it in merged mode and one-character chats. It is excluded from the preparation policy hash, so turning it on or off doesn't invalidate saved memory snapshots. - **Who decides:** with **Use Decision model** on, the Decision model answers one presence question per character and message ("present and able to see or hear it, even without speaking?"), present = score at or above the backend's calibrated threshold. When a scene-end check runs, these questions ride in the same `askMixed` request if they fit the batch and state limits; otherwise they go in their own request. If the shared request's presence answers are unusable, the scene-end questions are retried alone, so the scene check never falls back to the helper because of presence. Without a Decision model, the Advanced Memory helper answers inside its due scene-check call (`{"ends":[...],"visibility":[...]}`), or in a separate call when no scene check is due or the check was batched with a tracker. If that shared answer comes back cut off, incomplete or without usable `ends`, the scene check is asked again on its own (nothing is hidden for those messages); a connection error is not retried, so a broken helper isn't waited on twice. Helper names are mapped case-insensitively with a unique first-name fallback; omitted or unknown names hide nothing. - **Hint, not decisive:** the model also receives the characters who sent a message since the current scene started (Advanced Memory's saved scene boundary, or a bounded recent window). - **Applying:** decisions are written through the existing `hiddenFromAICharacterIds` on the message and all swipes, so the normal crossed-eye marker shows them. `extra.autoVisibility` records the decision; each message is decided once. The existing message-extra route marks any user change to `hiddenFromAICharacterIds` as `visibilityManual`, and so does the `bulk-hidden` route behind `/hide` and `/unhide`; automation never touches such a message, nor one that already had a hide, nor a message hidden from all. Both keys survive new swipes. - **Never hidden from:** the Advanced Memory narrator, the roleplay-command narrator, the message's author, and a whisper's recipient. The whisper-recipient exclusion is a marked `ponytail:` shortcut: on staging today a hidden message drops its whispers, so this keeps whispers working regardless of merge order. Once #7196 (#7191) lands, it can be removed so an absent recipient gets only the whisper. The #7191 whisper logic itself is untouched. - **Ordering:** a per-chat visibility lock (separate from the long-running memory queue) covers deciding and applying. `/generate` settles undecided recent messages (last 8, 20-second limit) before loading history, and again between replies of the same individual-mode turn, so no character generates before earlier messages are decided. The post-reply check decides the turn's last reply before any scene summary starts. - **Fail-open:** errors, timeouts and unusable answers hide nothing, are logged with the Pino logger, and mark the message decided so a broken connection doesn't delay every turn. Toggle off makes no extra calls. - **Debug logging:** helper prompts go through the shared `askHelperJson` with `logDebugOverride` (debugMode / `DEBUG_AGENTS`); Decision requests use the backend's existing debug logging, plus a debug line with the decided hides. - **Refactor:** the post-generation scene check's helper request now uses the extracted `helperBudget` / `askHelperJson` helpers (same prompts, limits, errors and debug text). - Docs: `docs/agents/memory.md` (new **Deciding who sees new messages** section), `docs/chats/messages.md` (Hide from AI). CHANGELOG entry added. Translations: #7202. ## 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` Agent-run checks (not a substitute for the boxes above): - `pnpm check` stages: impeccable, localization, format, lint, e2e types, token-estimation types and build all pass. - New `scripts/regressions/advanced-memory-visibility.regression.ts` (fake helper + fake Decision backend; narrator, Maukie present, Pantalone away, persona P): hides from Pantalone only; never the narrator or author; first-name and upper-case helper answers map correctly; swipes stay in sync; decided messages are not asked again; manual changes before and after automation persist; a pre-existing hide is left alone; a failed call hides nothing; toggle off, merged mode and one-character chats make no call; the helper answers presence inside a due scene check; the Decision model gets presence and scene-end questions in one request, or presence alone when no check is due; through `/generate`, visibility settles before each character in the turn and Pantalone's prompt lacks the earlier lines while the narrator's has them. Mutation-checked: removing either route guard fails the regression. - The regression also covers a whisper recipient never being a candidate, and a shared Decision request with unusable presence answers retrying the scene check alone (mutation-checked). - New e2e in `e2e/advanced-memory.e2e.ts`: the switch shows and saves in an individual group chat, and is absent in merged mode and in a one-character chat. Passed on `desktop-chromium` and `mobile-chromium`; the existing Decision-connection e2e next to it still passes. - Existing regressions rerun and passing: all 12 `advanced-memory-*`, `slash-command-usage`, `regeneration-context`, `roleplay-whisper-generation`, `prompt*`, `past-reasoning-history`, `prompt-controls`, `decision-conditionals`, `smart-group-decision`. Local CodeRabbit review (first pass, 3 findings): - Fixed: missing presence scores no longer rely on a non-null assertion; a missing score keeps the character. - Fixed: a shared Decision request with unusable presence answers now retries the scene-end questions alone (regression added). - Not changed, by design: "don't record failed decisions, retry later". A failed decision is still recorded with nothing hidden. Retrying would make every later turn wait on a broken connection again, and the between-replies guard could then change a source message of a reply in progress, which fails that reply's memory check ("Chat history changed before generation"). The user can still hide the message by hand. This is commented in `withVisibility`. Adversarial verification pass (separate agent, commits `ac42fd87a`, `2d1e4437d`, staging merge `49b0ee997`): - Found and fixed: `/hide` then `/unhide` (the `bulk-hidden` route) didn't count as the user's choice, so automation could later hide a message the user had just restored for everyone. The route now saves `visibilityManual` like the **Hide from AI** button (`bulkSetHiddenFromAI` takes optional extra fields; automatic summary hides are unchanged). - Found and fixed: with the helper (no Decision model), a shared scene-and-presence answer without usable `ends` failed the whole scene check ("The scene helper returned an invalid scene decision"), so turning the switch on could break a scene check that would otherwise pass. It now retries the scene check alone, matching the Decision path. A connection error still fails as before. - Regression extended for both (mutation-checked: reverting either fix fails it). The PR's existing assertions are unchanged. - Probed without new code changes, all as intended: both narrators and the author are never hidden even when the model says they're absent; ambiguous first names and garbage helper replies hide nothing; content edits, swipes (`POST …/swipes` and `/generate` regenerate) keep the decision and the manual flag; regenerations make no new visibility call; paused memory, Conversation mode, merged and one-character chats make no call; Stop during the start-of-generation check writes nothing and ends cleanly; a hung helper times out at 20 s and the reply goes ahead with nothing hidden; prompt preview (`/generate/dryRun`) stays read-only and never decides visibility. - Rerun on the final head: `pnpm check` passes (including `localization:check`), `pnpm regression:prompt` passes, all 13 `advanced-memory-*` regressions plus `roleplay-whisper-generation`, `roleplay-commands`, `slash-command-usage`, `regeneration-context`, `command-only-regenerate`, `roleplay-interrupt-generation`, `chat-story-export`, `past-reasoning-history`, `prompt-controls`, `decision-conditionals`, `smart-group-decision`, `spatial-only-message-visibility` and `issue-sweep-5391-5394` pass. The visibility e2e and the Decision-connection e2e pass on `desktop-chromium` and `mobile-chromium` (the Decision-connection e2e timed out once while the machine was loaded and passed on both reruns). Local CodeRabbit on the final head (after two rate-limit waits), 3 findings, none changed: - Not changed: "restore earlier `visibilityManual` values when `bulkSetHiddenFromAI` rolls back". A rollback can leave `visibilityManual` on some rows the user tried to change; that only stops automation for those messages, so they stay visible to every character (the same result as a failed decision). The method's all-or-nothing contract covers `hiddenFromAI`, which callers record as ownership, and that is still restored. - Not changed, by design (same as the earlier declined finding): "leave `plan.asked` false after an unusable shared answer so visibility gets its own call". Each message is decided once and a failure hides nothing; a third call would hold the next reply longer. - Not changed: "drop globally hidden replies from the running prompt between replies". Nothing automatic sets `hiddenFromAI`, and the refresh only applies automatic per-character results; a user hiding a reply for everyone in the middle of a turn behaves exactly as on staging (and with the switch off). Changing that is a separate behavior change. ### Manual verification notes - Manually verify in a Roleplay group chat set to individual replies: open **Chat Settings → Memory Recall → Advanced Memory Recall**, choose a **Narrator**, and turn on **Decide who sees new messages**. Send a message while one character is clearly elsewhere; confirm the crossed-eye marker on the new messages shows only the absent character, never the narrator or the speaker. - Manually verify that the next character's reply doesn't mention what the absent character couldn't know, and that the absent character's own turn (if it replies) doesn't see those lines. - Manually verify a manual change wins: unhide an automatically hidden message from its **Hide from AI** chooser, send more messages, and confirm that message stays unhidden. Repeat with `/hide N` then `/unhide N` on a new message before the next reply, and confirm no character is hidden from it afterwards. - Manually verify with **Use Decision model** on (a Jev connection) and again with it off (helper only), with **Debug mode** on: the server log shows the presence questions or the visibility prompt, and with a due scene check only one helper request is made. - Manually verify the switch is absent in a merged group chat and a one-character Roleplay chat, in light and dark mode and at phone width. - Manually verify a broken helper connection hides nothing and the chat still replies (expect up to about 20 seconds of extra wait before each reply while it times out). ## 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) Docs touched: `docs/agents/memory.md`, `docs/chats/messages.md`, `CHANGELOG.md`. ## UI evidence (if applicable) New switch under **Narrator** in Advanced Memory settings. The new e2e saves `memory-message-visibility-on-light.png` and `-dark.png` in its test output. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Advanced Memory can automatically hide new messages from characters who are not present in the scene in group chats where characters reply one at a time. The option is off by default and unavailable in merged group chats and solo chats. * The narrator, message author, and whisper recipient retain access. Manual **Hide from AI** choices are preserved. If visibility cannot be determined, the message remains visible to all characters. * **Documentation** * Updated the Advanced Memory and message visibility guides with details about the setting and how it works. <!-- 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:05:56 +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#7621
No description provided.