mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#7762
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 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)
16efccefeat(memory): split new Roleplay replies at POV breaks into separate messages (#7481)4c12d9efix(chat): keep split-part handling inside the shared message_saved path913252cfix(memory): close audience gaps in split Roleplay replies (#7481)e53f68bfix(chat): read every split part on stream-end autoplay; plain-language docs6b01509fix(chat): keep the ready event's abort release within its regression windowb44117efix(memory): keep splitting after stray inline tags, never leave half a reply, prepare TTS parts at oncef0ea880Merge 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
Linked issue
Closes #7481
Why this change
***or---. For example, the first part follows Cyno alone, and after***the rest follows Mari and Maukie somewhere else.What changed
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.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.use-generate.ts): each earlier part arrives as a normalmessage_savedevent with aremainingContentfield. 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'smessage_savedandassistant_message_readyare unchanged.roleplay-commands.ts):parseRoleplayCommandsnow also returns where each command was. Only whispers still save a position, so how existing commands display doesn't change.placeRoleplayActivityInPartsassigns commands to parts.Where each attachment goes
thinking,chatCompletionsReasoning,encryptedReasoningstartsNewAssistantBubblegeminiParts(Gemini thought signatures)update_game_statetool writes, scene-check anchor (asOfMessageId), active agent runs[illustrate]/sound/music/combat media requestscontextInjections,generationReplay,referencedCharacterIds,roleplayPrivateContextassistant_message_readystill 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.Follow-up fixes from review
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).<details>status panel, doesn't split.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.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 checkpasses locallyCONTRIBUTING.mdAgent-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 inHomeProfessorMariChat.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.--committedagainst 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.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 withremainingContent; 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.past-reasoning-history);<details>blocks, self-closing and void tags in the splitter, and a strippedName:prefix in command placement (roleplay-commands); autoplay of earlier parts, the stream-end fallback's part lookup and the held-rewriteremainingContent(roleplay-streaming).Manual verification notes
***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.***follows others gets a separate crossed-eye marker on each part, and that Hide from AI can be changed per part.***keeps only the text before it.***in the text don't split.<details>status panel containing---stays one message.***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-i18nbranch 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.mdfollow-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
Bug Fixes
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.