[PR #7497] [MERGED] feat(memory): split new Roleplay replies at POV breaks into separate messages (#7481) #7762

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

📋 Pull Request Information

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

Base: staging ← Head: feat/advanced-memory-pov-split


📝 Commits (7)

  • 16efcce feat(memory): split new Roleplay replies at POV breaks into separate messages (#7481)
  • 4c12d9e fix(chat): keep split-part handling inside the shared message_saved path
  • 913252c fix(memory): close audience gaps in split Roleplay replies (#7481)
  • e53f68b fix(chat): read every split part on stream-end autoplay; plain-language docs
  • 6b01509 fix(chat): keep the ready event's abort release within its regression window
  • b44117e fix(memory): keep splitting after stray inline tags, never leave half a reply, prepare TTS parts at once
  • f0ea880 Merge branch 'staging' into feat/advanced-memory-pov-split

📊 Changes

16 files changed (+829 additions, -158 deletions)

View changed files

📝 docs/agents/memory.md (+11 -0)
📝 packages/client/src/components/chat/ChatArea.tsx (+74 -54)
📝 packages/client/src/hooks/use-generate.ts (+23 -3)
📝 packages/client/src/lib/tts-autoplay.ts (+27 -0)
📝 packages/server/src/routes/generate.routes.ts (+218 -78)
📝 packages/server/src/services/advanced-memory.ts (+5 -1)
📝 packages/server/src/services/generation/generation-parameters.ts (+3 -1)
📝 packages/server/src/services/generation/roleplay-commands.ts (+61 -3)
📝 packages/server/src/services/storage/chats.storage.ts (+2 -0)
📝 packages/shared/src/index.ts (+1 -0)
➕ packages/shared/src/utils/scene-breaks.ts (+44 -0)
📝 scripts/regressions/advanced-memory-post-generation.regression.ts (+138 -11)
📝 scripts/regressions/advanced-memory-visibility.regression.ts (+81 -7)
📝 scripts/regressions/past-reasoning-history.regression.ts (+19 -0)
📝 scripts/regressions/roleplay-commands.regression.ts (+76 -0)
📝 scripts/regressions/roleplay-streaming.regression.ts (+46 -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 #7481

Why this change

  • In Roleplay with Advanced Memory, one reply often follows several characters in different places. The model marks the switch with a scene-break line such as *** or ---. For example, the first part follows Cyno alone, and after *** the rest follows Mari and Maukie somewhere else.
  • Who sees a message is decided per message: Decide who sees new messages, Hide from AI and whispers. Today the whole reply therefore has a single audience, so Cyno's private part and the Mari/Maukie part can't be shown to different characters. Splitting the reply at the break lets each part have its own audience.

What changed

  • Splitter (packages/shared/src/utils/scene-breaks.ts, splitAtSceneBreaks): splits at any Markdown thematic break on its own line, meaning 3 or more of one of *, - or _, with optional spaces or tabs between them and up to 3 leading spaces (***, ---, ___, * * *). Breaks inside fenced code blocks are ignored. The break line stays as the first line of the part after it. A break at the very start or end, or two breaks next to each other, never creates an empty part. Text with no break comes back unchanged.
  • Save path (generate.routes.ts, generateForCharacter): with Advanced Memory on (Roleplay only), a new reply is saved as one message per part. All parts come from the same character and are saved in order. Regenerate/swipe, Continue and Impersonate still save one message, so swipes never insert extra messages. In individual group mode, each responder's reply splits on its own. In merged mode, the single merged reply splits, and every part keeps the generation's character.
  • Callers: the individual loop and the single/merged path record every part as its own reply. That includes the next responder's running context, the in-turn visibility settling (#7192), agent text with each part's own whispers, and mention routing over the whole reply.
  • Client (use-generate.ts): each earlier part arrives as a normal message_saved event with a remainingContent field. The client waits for the typewriter to finish, inserts the part into the chat and, in the same tick, replaces the live bubble's text with the rest of the reply. The live bubble keeps the stream, so nothing appears twice and no row blinks out. The thinking buffer is cleared because the first part now shows the reasoning. The last part's message_saved and assistant_message_ready are unchanged.
  • Parser (roleplay-commands.ts): parseRoleplayCommands now also returns where each command was. Only whispers still save a position, so how existing commands display doesn't change. placeRoleplayActivityInParts assigns commands to parts.

Where each attachment goes

What Part Why
Reasoning: thinking, chatCompletionsReasoning, encryptedReasoning First, shown but never replayed It was produced by the prompt the first part answers. A swipe of the first part sends the same prompt again. It covers every part, so it isn't sent back as past reasoning even with Exclude Past Reasoning off: a later part may be hidden from the reader.
Advanced Memory preparation snapshot First A snapshot is checked against the history before its message. Only the first part's history matches, so a swipe of the first part reuses it. A later part's swipe prepares memory again, which is also what would happen to it anyway.
startsNewAssistantBubble First (false on the others) The turn starts there.
geminiParts (Gemini thought signatures) None on a split reply They hold the whole reply's text and replace a message's text when replayed. Kept on the first part, they would send the later parts to readers who can't see them.
Generation info and usage, cached prompt (Peek Prompt), Advanced Memory receipt, chat-summary fingerprint, lorebook scan (Active Context) Last Records of the turn's request. Peek Prompt and Active Context read the latest reply, and the prompt cache cleanup keeps the last two assistant messages.
Agents, trackers, Illustrator agent, game-state/spatial rows and update_game_state tool writes, scene-check anchor (asOfMessageId), active agent runs Last These are keyed to "the latest reply", the same way a group turn anchors to its last reply.
Pre-generation agent runs (Narrative Director) First They are anchored, as before, to the turn's first saved assistant message.
Roleplay commands: whispers, documents, notes, memory, [illustrate]/sound/music/combat media requests The part whose text contained them They keep that part's audience. Inline whisper and roll places are re-anchored inside that part.
Interrupt command, and commands without a position (DM) Last An interruption is committed atomically with the last part.
contextInjections, generationReplay, referencedCharacterIds, roleplayPrivateContext Every part Each part can be regenerated on its own and replays the same guidance. Merged avatars show on each part.
Automatic output translation Every part, in order
TTS autoplay Every part, in order, as one sequence assistant_message_ready still fires for the last part; the client adds the turn's earlier parts it already received. The stream-end fallback finds them from the saved rows.
Prose Guardian and other text-rewrite agents Last part only (documented) Writing the rewritten joined text into the last part would duplicate the earlier parts. Rewriting earlier parts needs a new client event for rows already in the chat; left as a maintainer decision. While a rewrite holds the reply, the live bubble stays empty until the rewrite arrives.
Discord webhook mirror Whole reply, one post

Follow-up fixes from review

  • Swipe of an earlier part: earlier parts carry continuesAfterSceneBreak (kept on swipes). Regenerating one keeps only the text before the model's first break, and drops commands written after it. Its prompt brings back the whole reply, and keeping that would show later scenes under the earlier part's audience and duplicate them in the chat. It is still one message, so swipes never insert messages (decision 4).
  • Long split replies: the visibility pass looks at the last 8 messages. It now reaches back over a split reply's earlier parts, so a reply with 9 or more parts is decided whole.
  • HTML blocks: a break inside an open HTML element, such as a <details> status panel, doesn't split.
  • Command places: a command's place is found even when cleanup stripped a leading Name: (shorter unique anchors, down to 12 characters). If it still can't be found, it goes to the part at the same relative position instead of the last part.
  • Docs: the author still sees every part (existing rule, advanced-memory-visibility.regression.ts "the author always sees their own message", unchanged); rewrite agents edit only the last part; autoplay reads every part.

No staging assertion was changed or weakened. One assertion this PR added changed: regenerating the first part now expects CYNO_ALONE waits by the gate. (its own scene) instead of the whole reply.

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: passed (exit 0) on the latest commit. The only ESLint warning is an existing one in HomeProfessorMariChat.tsx, which this PR doesn't touch.
  • node ./scripts/run-regressions.mjs --filter advanced-memory: 16/16 pass on the latest commit.
  • node ./scripts/run-regressions.mjs --filter roleplay: 14/14 pass.
  • node ./scripts/run-regressions.mjs --filter regeneration-context: 2/2 pass.
  • node ./scripts/run-regressions.mjs --filter context-fit: 2/2 pass.
  • node ./scripts/run-regressions.mjs --filter past-reasoning: 1/1 pass.
  • pnpm smoke:ui: 7/7 passed on the first commit; not re-run after the review fixes. These tests don't produce a split reply.
  • Local CodeRabbit (--committed against the staging merge base, after the review-fix commit): 3 findings, all fixed in the next commit. A dead assignment in the post-generation regression; the stream-end autoplay fallback passing only the last part; and the docs paragraph rewritten as short newcomer bullets. Not re-run after that small follow-up commit.
  • New proof in existing regression files:
    • roleplay-commands.regression.ts: splitter cases (***, ---, ___, * * *, indented breaks, code fences, leading/trailing/adjacent breaks, CRLF), plus command placement per part.
    • advanced-memory-post-generation.regression.ts: route split into two messages from the same character, in order, with the break line at the top of the second; reasoning and memory snapshot on the first part; generation info and Peek Prompt cache on the last; event order with remainingContent; scene check anchored on the last part; no split on regenerate (either part), Continue, Impersonate, with Advanced Memory off, or in Conversation mode.
    • advanced-memory-visibility.regression.ts: in an individual group, each part is decided separately (Pantalone hidden from part 1, not from part 2); the next responder reads only the part he was present for; each responder's reply splits on its own.
    • Review fixes: a swipe of the first part keeps only its scene and its own document, and stays marked (post-generation); a 10-part reply has every part decided (visibility); the first part's reasoning isn't replayed (past-reasoning-history); <details> blocks, self-closing and void tags in the splitter, and a stripped Name: prefix in command placement (roleplay-commands); autoplay of earlier parts, the stream-end fallback's part lookup and the held-rewrite remainingContent (roleplay-streaming).
  • With the split disabled, the post-generation and visibility regressions both fail. With the swipe trim, its command filter or the wider visibility window turned off, the matching new assertions fail.

Manual verification notes

  • Manually verify that, with Advanced Memory on in a one-character Roleplay chat, a reply containing *** shows two messages right after streaming ends, with the second starting with ***. Check that no text is duplicated and nothing flickers while the stream hands over.
  • Manually verify that the reasoning dropdown shows on the first part only, and the generation details (message info) on the last part.
  • Manually verify that, in an individual group chat with Decide who sees new messages on, a reply whose first part follows one character alone and whose part after *** follows others gets a separate crossed-eye marker on each part, and that Hide from AI can be changed per part.
  • Manually verify that swiping the second part, and separately the first, gives a new version of that one message, unsplit, with no messages inserted. For the first part, check that a new version whose text contains *** keeps only the text before it.
  • Manually verify that Continue on the last part and Impersonate with *** in the text don't split.
  • Manually verify that the parts appear correctly with streaming off.
  • Manually verify that, with Prose Guardian on, only the last part is rewritten, no text is duplicated, and the live reply shows the pending message rather than the raw last part until the rewrite arrives.
  • Manually verify that, with Roleplay TTS autoplay on, a split reply is read aloud from the first part to the last, and in Visual Novel display the highlighted paragraph follows each part.
  • Manually verify that a reply ending with a <details> status panel containing --- stays one message.
  • Manually verify that, with Advanced Memory off, a reply with *** stays one message.

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/agents/memory.md: one new short paragraph and bullet list under Deciding who sees new messages (author still sees every part, thinking isn't replayed, rewrite agents edit the last part, autoplay reads every part, and what a swipe of an earlier part keeps). No other paragraph changed.

  • A [docs-i18n] docs/agents/memory.md follow-up is needed for the translated packs. This PR does not open it.

  • No CHANGELOG entry, per the 2026-10-12 policy: the changelog is compiled from merged PRs at release time.

UI evidence (if applicable)

None captured. The client change only affects how the existing message rows and live bubble hand over at the end of streaming.

Summary by CodeRabbit

  • New Features

    • With Advanced Memory enabled, roleplay replies can be split into separate messages at scene breaks. Visibility, roleplay activity, and translations are handled for each part.
    • Speech playback follows the order of the split messages, and swiping or regenerating an earlier part keeps the replacement within that scene.
    • Added documentation on how scene breaks affect message visibility, playback, Continue, and Impersonate.
  • Bug Fixes

    • Visibility checks now cover all parts of a split reply, including longer replies.
    • Earlier split parts no longer replay assistant reasoning or expose unrevised text during streaming.

🔄 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/7497 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/12/2026 **Status:** ✅ Merged **Merged:** 10/12/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `feat/advanced-memory-pov-split` --- ### 📝 Commits (7) - [`16efcce`](https://github.com/Pasta-Devs/Marinara-Engine/commit/16efccec1d213789f272e05d674b3ca06a523943) feat(memory): split new Roleplay replies at POV breaks into separate messages (#7481) - [`4c12d9e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4c12d9ebb8e6b975af8bd2a588909544e05f6239) fix(chat): keep split-part handling inside the shared message_saved path - [`913252c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/913252cd317a1dba94ae43fbc000e9fc0ef8b7b6) fix(memory): close audience gaps in split Roleplay replies (#7481) - [`e53f68b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e53f68b793a7238a4c5a9db5824e3d20f57b3efe) fix(chat): read every split part on stream-end autoplay; plain-language docs - [`6b01509`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6b015090b0085376a834ae848fa694d05127ba93) fix(chat): keep the ready event's abort release within its regression window - [`b44117e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b44117ee2fe1db2a0065494b6cfb275b6a2276d7) fix(memory): keep splitting after stray inline tags, never leave half a reply, prepare TTS parts at once - [`f0ea880`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f0ea88068af6c7f99d096005fd6321094032ff21) Merge branch 'staging' into feat/advanced-memory-pov-split ### 📊 Changes **16 files changed** (+829 additions, -158 deletions) <details> <summary>View changed files</summary> 📝 `docs/agents/memory.md` (+11 -0) 📝 `packages/client/src/components/chat/ChatArea.tsx` (+74 -54) 📝 `packages/client/src/hooks/use-generate.ts` (+23 -3) 📝 `packages/client/src/lib/tts-autoplay.ts` (+27 -0) 📝 `packages/server/src/routes/generate.routes.ts` (+218 -78) 📝 `packages/server/src/services/advanced-memory.ts` (+5 -1) 📝 `packages/server/src/services/generation/generation-parameters.ts` (+3 -1) 📝 `packages/server/src/services/generation/roleplay-commands.ts` (+61 -3) 📝 `packages/server/src/services/storage/chats.storage.ts` (+2 -0) 📝 `packages/shared/src/index.ts` (+1 -0) ➕ `packages/shared/src/utils/scene-breaks.ts` (+44 -0) 📝 `scripts/regressions/advanced-memory-post-generation.regression.ts` (+138 -11) 📝 `scripts/regressions/advanced-memory-visibility.regression.ts` (+81 -7) 📝 `scripts/regressions/past-reasoning-history.regression.ts` (+19 -0) 📝 `scripts/regressions/roleplay-commands.regression.ts` (+76 -0) 📝 `scripts/regressions/roleplay-streaming.regression.ts` (+46 -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 #7481 ## Why this change - In Roleplay with Advanced Memory, one reply often follows several characters in different places. The model marks the switch with a scene-break line such as `***` or `---`. For example, the first part follows Cyno alone, and after `***` the rest follows Mari and Maukie somewhere else. - Who sees a message is decided per message: **Decide who sees new messages**, **Hide from AI** and whispers. Today the whole reply therefore has a single audience, so Cyno's private part and the Mari/Maukie part can't be shown to different characters. Splitting the reply at the break lets each part have its own audience. ## What changed - **Splitter** (`packages/shared/src/utils/scene-breaks.ts`, `splitAtSceneBreaks`): splits at any Markdown thematic break on its own line, meaning 3 or more of one of `*`, `-` or `_`, with optional spaces or tabs between them and up to 3 leading spaces (`***`, `---`, `___`, `* * *`). Breaks inside fenced code blocks are ignored. The break line stays as the first line of the part after it. A break at the very start or end, or two breaks next to each other, never creates an empty part. Text with no break comes back unchanged. - **Save path** (`generate.routes.ts`, `generateForCharacter`): with Advanced Memory on (Roleplay only), a **new** reply is saved as one message per part. All parts come from the same character and are saved in order. Regenerate/swipe, Continue and Impersonate still save one message, so swipes never insert extra messages. In individual group mode, each responder's reply splits on its own. In merged mode, the single merged reply splits, and every part keeps the generation's character. - **Callers**: the individual loop and the single/merged path record every part as its own reply. That includes the next responder's running context, the in-turn visibility settling (#7192), agent text with each part's own whispers, and mention routing over the whole reply. - **Client** (`use-generate.ts`): each earlier part arrives as a normal `message_saved` event with a `remainingContent` field. The client waits for the typewriter to finish, inserts the part into the chat and, in the same tick, replaces the live bubble's text with the rest of the reply. The live bubble keeps the stream, so nothing appears twice and no row blinks out. The thinking buffer is cleared because the first part now shows the reasoning. The last part's `message_saved` and `assistant_message_ready` are unchanged. - **Parser** (`roleplay-commands.ts`): `parseRoleplayCommands` now also returns where each command was. Only whispers still save a position, so how existing commands display doesn't change. `placeRoleplayActivityInParts` assigns commands to parts. ### Where each attachment goes | What | Part | Why | | --- | --- | --- | | Reasoning: `thinking`, `chatCompletionsReasoning`, `encryptedReasoning` | First, shown but never replayed | It was produced by the prompt the first part answers. A swipe of the first part sends the same prompt again. It covers every part, so it isn't sent back as past reasoning even with **Exclude Past Reasoning** off: a later part may be hidden from the reader. | | Advanced Memory preparation snapshot | First | A snapshot is checked against the history before its message. Only the first part's history matches, so a swipe of the first part reuses it. A later part's swipe prepares memory again, which is also what would happen to it anyway. | | `startsNewAssistantBubble` | First (false on the others) | The turn starts there. | | `geminiParts` (Gemini thought signatures) | None on a split reply | They hold the whole reply's text and replace a message's text when replayed. Kept on the first part, they would send the later parts to readers who can't see them. | | Generation info and usage, cached prompt (Peek Prompt), Advanced Memory receipt, chat-summary fingerprint, lorebook scan (Active Context) | Last | Records of the turn's request. Peek Prompt and Active Context read the latest reply, and the prompt cache cleanup keeps the last two assistant messages. | | Agents, trackers, Illustrator agent, game-state/spatial rows and `update_game_state` tool writes, scene-check anchor (`asOfMessageId`), active agent runs | Last | These are keyed to "the latest reply", the same way a group turn anchors to its last reply. | | Pre-generation agent runs (Narrative Director) | First | They are anchored, as before, to the turn's first saved assistant message. | | Roleplay commands: whispers, documents, notes, memory, `[illustrate]`/sound/music/combat media requests | The part whose text contained them | They keep that part's audience. Inline whisper and roll places are re-anchored inside that part. | | Interrupt command, and commands without a position (DM) | Last | An interruption is committed atomically with the last part. | | `contextInjections`, `generationReplay`, `referencedCharacterIds`, `roleplayPrivateContext` | Every part | Each part can be regenerated on its own and replays the same guidance. Merged avatars show on each part. | | Automatic output translation | Every part, in order | | | TTS autoplay | Every part, in order, as one sequence | `assistant_message_ready` still fires for the last part; the client adds the turn's earlier parts it already received. The stream-end fallback finds them from the saved rows. | | Prose Guardian and other text-rewrite agents | Last part only (documented) | Writing the rewritten joined text into the last part would duplicate the earlier parts. Rewriting earlier parts needs a new client event for rows already in the chat; left as a maintainer decision. While a rewrite holds the reply, the live bubble stays empty until the rewrite arrives. | | Discord webhook mirror | Whole reply, one post | | ### Follow-up fixes from review - **Swipe of an earlier part:** earlier parts carry `continuesAfterSceneBreak` (kept on swipes). Regenerating one keeps only the text before the model's first break, and drops commands written after it. Its prompt brings back the whole reply, and keeping that would show later scenes under the earlier part's audience and duplicate them in the chat. It is still one message, so swipes never insert messages (decision 4). - **Long split replies:** the visibility pass looks at the last 8 messages. It now reaches back over a split reply's earlier parts, so a reply with 9 or more parts is decided whole. - **HTML blocks:** a break inside an open HTML element, such as a `<details>` status panel, doesn't split. - **Command places:** a command's place is found even when cleanup stripped a leading `Name:` (shorter unique anchors, down to 12 characters). If it still can't be found, it goes to the part at the same relative position instead of the last part. - **Docs:** the author still sees every part (existing rule, `advanced-memory-visibility.regression.ts` "the author always sees their own message", unchanged); rewrite agents edit only the last part; autoplay reads every part. No staging assertion was changed or weakened. One assertion this PR added changed: regenerating the first part now expects `CYNO_ALONE waits by the gate.` (its own scene) instead of the whole reply. ## 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`: passed (exit 0) on the latest commit. The only ESLint warning is an existing one in `HomeProfessorMariChat.tsx`, which this PR doesn't touch. - `node ./scripts/run-regressions.mjs --filter advanced-memory`: 16/16 pass on the latest commit. - `node ./scripts/run-regressions.mjs --filter roleplay`: 14/14 pass. - `node ./scripts/run-regressions.mjs --filter regeneration-context`: 2/2 pass. - `node ./scripts/run-regressions.mjs --filter context-fit`: 2/2 pass. - `node ./scripts/run-regressions.mjs --filter past-reasoning`: 1/1 pass. - `pnpm smoke:ui`: 7/7 passed on the first commit; not re-run after the review fixes. These tests don't produce a split reply. - Local CodeRabbit (`--committed` against the staging merge base, after the review-fix commit): 3 findings, all fixed in the next commit. A dead assignment in the post-generation regression; the stream-end autoplay fallback passing only the last part; and the docs paragraph rewritten as short newcomer bullets. Not re-run after that small follow-up commit. - New proof in existing regression files: - `roleplay-commands.regression.ts`: splitter cases (`***`, `---`, `___`, `* * *`, indented breaks, code fences, leading/trailing/adjacent breaks, CRLF), plus command placement per part. - `advanced-memory-post-generation.regression.ts`: route split into two messages from the same character, in order, with the break line at the top of the second; reasoning and memory snapshot on the first part; generation info and Peek Prompt cache on the last; event order with `remainingContent`; scene check anchored on the last part; no split on regenerate (either part), Continue, Impersonate, with Advanced Memory off, or in Conversation mode. - `advanced-memory-visibility.regression.ts`: in an individual group, each part is decided separately (Pantalone hidden from part 1, not from part 2); the next responder reads only the part he was present for; each responder's reply splits on its own. - Review fixes: a swipe of the first part keeps only its scene and its own document, and stays marked (post-generation); a 10-part reply has every part decided (visibility); the first part's reasoning isn't replayed (`past-reasoning-history`); `<details>` blocks, self-closing and void tags in the splitter, and a stripped `Name:` prefix in command placement (`roleplay-commands`); autoplay of earlier parts, the stream-end fallback's part lookup and the held-rewrite `remainingContent` (`roleplay-streaming`). - With the split disabled, the post-generation and visibility regressions both fail. With the swipe trim, its command filter or the wider visibility window turned off, the matching new assertions fail. ### Manual verification notes - Manually verify that, with Advanced Memory on in a one-character Roleplay chat, a reply containing `***` shows two messages right after streaming ends, with the second starting with `***`. Check that no text is duplicated and nothing flickers while the stream hands over. - Manually verify that the reasoning dropdown shows on the first part only, and the generation details (message info) on the last part. - Manually verify that, in an individual group chat with **Decide who sees new messages** on, a reply whose first part follows one character alone and whose part after `***` follows others gets a separate crossed-eye marker on each part, and that **Hide from AI** can be changed per part. - Manually verify that swiping the second part, and separately the first, gives a new version of that one message, unsplit, with no messages inserted. For the first part, check that a new version whose text contains `***` keeps only the text before it. - Manually verify that Continue on the last part and Impersonate with `***` in the text don't split. - Manually verify that the parts appear correctly with streaming off. - Manually verify that, with Prose Guardian on, only the last part is rewritten, no text is duplicated, and the live reply shows the pending message rather than the raw last part until the rewrite arrives. - Manually verify that, with Roleplay TTS autoplay on, a split reply is read aloud from the first part to the last, and in Visual Novel display the highlighted paragraph follows each part. - Manually verify that a reply ending with a `<details>` status panel containing `---` stays one message. - Manually verify that, with Advanced Memory off, a reply with `***` stays one message. ## 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/agents/memory.md`: one new short paragraph and bullet list under *Deciding who sees new messages* (author still sees every part, thinking isn't replayed, rewrite agents edit the last part, autoplay reads every part, and what a swipe of an earlier part keeps). No other paragraph changed. - A `[docs-i18n] docs/agents/memory.md` follow-up is needed for the translated packs. This PR does not open it. - No CHANGELOG entry, per the 2026-10-12 policy: the changelog is compiled from merged PRs at release time. ## UI evidence (if applicable) None captured. The client change only affects how the existing message rows and live bubble hand over at the end of streaming. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * With Advanced Memory enabled, roleplay replies can be split into separate messages at scene breaks. Visibility, roleplay activity, and translations are handled for each part. * Speech playback follows the order of the split messages, and swiping or regenerating an earlier part keeps the replacement within that scene. * Added documentation on how scene breaks affect message visibility, playback, Continue, and Impersonate. * **Bug Fixes** * Visibility checks now cover all parts of a split reply, including longer replies. * Earlier split parts no longer replay assistant reasoning or expose unrevised text during streaming. <!-- 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:07:16 +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#7762
No description provided.