mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #7387] [MERGED] fix(roleplay): keep model whispers in place after the reply is edited #7710
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#7710
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/7387
Author: @SpicyMarinara
Created: 10/10/2026
Status: ✅ Merged
Merged: 10/10/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/whisper-position📝 Commits (7)
a8d5049fix(roleplay): keep model whispers in place after the reply is edited337f938fix(roleplay): follow the unchanged text around a whisper through an edit6ada138fix(roleplay): move whispers only when their saved text no longer places themfe42b2ffix(roleplay): keep a whisper's first place and prefer it while its text is there001f0d9fix(roleplay): re-anchor the active swipe's activity from its own texte8522c1fix(roleplay): re-anchor each saved activity list on its owncd5d04ffix(roleplay): trust an anchor in its place over one found elsewhere📊 Changes
5 files changed (+246 additions, -24 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
packages/server/src/services/storage/chats.storage.ts(+31 -6)📝
packages/shared/src/types/roleplay-command.ts(+92 -16)📝
packages/shared/src/utils/quote-format.ts(+2 -1)📝
scripts/regressions/roleplay-whisper-generation.regression.ts(+120 -1)📄 Description
Linked issue
Closes #7386
Why this change
contentOffsetandcontentAnchor, the 80 characters before it.getRoleplayCommandContentOffsetuses the offset if the anchor still matches there, then the anchor's only match, then the end.What changed
getRoleplayCommandContentOffset(shared) compares the text and the anchor with straight quotes (toStraightQuotes, now exported). Curling keeps the text length, so offsets still line up. This puts whispers in replies that were already edited back in place, with no data migration. Dice-roll results and whisper placement in prompts use the same function.reanchorRoleplayCommandActivity(shared) runs fromupdateMessageContenton every content change: manual edits, rewrite agents, retries, continuations and corrections. It works on the message row and the active swipe, each from its own list, and leaves commands typed into the edit as prepared. It moves a result only when its saved text no longer places it:originalContentOffset/originalContentAnchor). Placement tries saved anchors at their saved offsets first (original, then current), and only then searches the text for them. Undoing an edit and toggling Prose Guardian back both restore the original place, and editing away one copy of a repeated phrase no longer pulls the whisper to the other copy.roleplay-whisper-generation): a real model reply edited through the PATCH route (the sentence before the whisper reworded, all quotes curled), straight-quote anchors on curled text, and these cases: two typos around a whisper, edits on both sides, a deleted sentence before it, an insertion right after it, a full rewrite (stays at the end), rewrite and toggle back, delete and restore, two edits and restore, a repeated phrase (stays at the end), and one copy of a repeated phrase edited away.Review
Validation
pnpm checkpasses locallyCONTRIBUTING.mdCommands run by the agent:
pnpm check;node ./scripts/run-regressions.mjs --filterfor roleplay-whisper-generation, roleplay-whisper-hidden-recipient, roleplay-user-private-generation, roleplay-user-private-storage, roleplay-commands, roleplay-interrupt-storage, roleplay-interrupt-generation, roleplay-streaming, roleplay-swipe-media, roleplay-regeneration-context, roleplay-vn-paragraphs, dice-display, message-edit-delete-races, message-trash, regeneration-context, manual-agent-retry-resolution, character-id-macro-modes, open-issues, advanced-memory-core, advanced-memory-post-generation and prompt (all pass on the final head or the commit before it).Manual verification notes
Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)CHANGELOG
[Unreleased]has an entry. No user docs change.Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.