mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #7196] [MERGED] fix(roleplay): keep whispers for their recipient when a message is hidden from them #7618
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#7618
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/7196
Author: @SpicyMarinara
Created: 10/6/2026
Status: ✅ Merged
Merged: 10/7/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/whisper-survives-hide-7191📝 Commits (5)
cecaac7fix(roleplay): keep whispers for their recipient when a message is hidden from themf1f6064fix(roleplay): keep hidden-whisper stand-ins in every preview path81358a4Merge remote-tracking branch 'origin/staging' into fix/whisper-survives-hide-7191144b8a1fix(roleplay): keep the whisper of a hidden message that opens the Advanced Memory window (#7191)a70cca7Merge remote-tracking branch 'origin/staging' into fix/whisper-survives-hide-7191📊 Changes
13 files changed (+489 additions, -33 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
docs/chats/messages.md(+2 -0)📝
docs/roleplay/getting-started.md(+4 -2)📝
packages/client/src/components/chat/ChatMessage.tsx(+2 -1)📝
packages/client/src/components/chat/RoleplayCommandResults.tsx(+10 -6)📝
packages/client/src/localization/locales/en.json(+1 -0)📝
packages/server/src/routes/chats.routes.ts(+12 -0)📝
packages/server/src/routes/generate.routes.ts(+7 -3)📝
packages/server/src/routes/generate/dry-run-route.ts(+44 -8)📝
packages/server/src/services/generation/prompt-message-scope.ts(+51 -7)📝
packages/server/src/services/generation/roleplay-commands.ts(+39 -5)📝
scripts/regressions/roleplay-whisper-generation.regression.ts(+4 -1)➕
scripts/regressions/roleplay-whisper-hidden-recipient.regression.ts(+312 -0)📄 Description
Linked issue
Closes #7191
Why this change
appendRoleplayWhispersonly fills messages still in the viewer's prompt).What changed
filterPromptMessagesForCharacterAudience) leaves a history stand-in at the message's place. It holds just the existing[Private whisper]placeholder and no id, andappendRoleplayWhispersfills in the usual[Private whisper to ...]fragment right after it. None of the hidden narration, attachments, reasoning, private note or the interrupt target comes along.roleplayHiddenWhisperMessageIdsalso skips them because the preview's Advanced Memory source list includes them.filterPromptHistoryByMessageIdskeeps a stand-in inside the live window. That window also takes in the hidden messages right before its first retained message (keptWindowStart), so a hidden message that opens the character's history, such as the chat's first message or the first one after a scene or conversation start, keeps its whisper. The preview's Advanced Memory pre-filter uses the same rule, counting only messages the live prompt shows before memory selection, and only offers whispers from the latest conversation start on, like the live route. Known ceiling (markedponytail:): the window cannot see the memory boundary itself, so a hidden message that ends the previous scene, or comes right before a character's knowledge start, also keeps its whisper. Advanced Memory summaries and archives stay whisper-free, as they are today.roleplayCallerIdcalculation up so the filter andappendRoleplayWhispersuse the same viewer. The dry-run route computes that viewer once and reuses it for whispers and notes. Its prompt-parts and no-preset history projections also keep the stand-in'swhisperSourceId.PATCH /messages/:id/extraroute also removes any whitespace-only whisper. Errored whisper records and other commands are left as they are. A placeholder line explains it: "Leave this empty and save to remove the whisper." (newen.jsonkeyroleplay.commands.whisper.emptyRemoves). Each whisper editor is keyed by the whisper's original command text, so an editor left open while that whisper is replaced elsewhere closes instead of saving over, or removing, the replacement.roleplay-whisper-generation.regression.tsasserted that hiding the message from Bob also hides Bob's whisper (assert(!(await preview(bob.id)).includes("BOB_ONLY_SECRET"))). That is exactly the behavior #7191 reverses, so that single assertion now checks the reverse: Bob gets his whisper but not the hidden narration. Every other assertion in that file is unchanged.scripts/regressions/roleplay-whisper-hidden-recipient.regression.ts(Maukie, Pantalone, Narrator, persona Mari, Individual group). It covers live and preview, including the no-preset and prompt-parts previews, the whisper's position between the opening line and a later message, no narration, Pantalone getting nothing, narrator and persona unchanged, no narrator resurrection, the history limit, global hide, emptied-whisper removal, a hidden opening message with Advanced Memory on (live and preview), and the Advanced Memory window rule. It fails onorigin/staging("Maukie still receives the whisper fragment") and passes here.CHANGELOG.md,docs/roleplay/getting-started.md(Whispers and secrets) anddocs/chats/messages.md(Hiding a message from the AI).Validation
pnpm checkpasses locallyCONTRIBUTING.mdCommands run by the agent:
node ./scripts/run-regressions.mjs --filter roleplay-whisper: both whisper regressions pass. The new one fails on the unchanged source.pnpm check: passes locally (exit 0), both before and after merging the lateststaging(CHANGELOG conflict only).node ./scripts/run-regressions.mjs --filter <name>forroleplay-(14 regressions),advanced-memory-(11),prompt.regression(5),prompt-controls,regeneration-context,past-reasoning-history,spatial-only-message-visibility,message-marks,multiplayer-room,slash-command-usageandroleplay-commands: all pass.144b8a1a6): found that with Advanced Memory on, a hidden message that opens the character's history (for example the chat's first message) lost its whisper again, live and in the preview, because a stand-in was kept only after the first retained message. Fixed with the window rule above. The extended regression fails on the previous head ("Advanced Memory keeps the whisper of the message that opens the window") and passes now. Temporary probes, since removed, also checked: several whispers to different recipients in one hidden message (order kept, no duplicates, each recipient gets only their own), merged group mode and Conversation mode (no stand-in, no placeholder), a persona message whispering to a character, swipes (only the active swipe's whisper; emptying one swipe's whisper leaves the other swipe untouched), regeneration, a later per-character conversation start, speaker names in history, a one-character chat, and with Advanced Memory a knowledge start, a conversation start, the latest message and a globally hidden message in between, with matching live and preview prompts.staging(CHANGELOG conflict only):pnpm check,pnpm regression:prompt, andnode ./scripts/run-regressions.mjs --filterforroleplay-whisper,roleplay-(14),advanced-memory-(12),prompt.regression,prompt-controls,regeneration-context,past-reasoning-history,spatial-only-message-visibility,message-marks,multiplayer-(13),slash-command-usage,code-scanning-prompt-parsing,group-prompt-regex,capability-gm-verbs,illustrator-manual-cadence,game-narration-text,game-ruleset-layersandruleset-: all pass.coderabbit review --agent --committed, basef8e906cdc): review completed with 0 findings on all 12 changed files of the first commit.f1f606428: the preview projections dropped the stand-in's source id (the new regression failed onskipPresetbefore the fix), and an open whisper editor could save over a replaced whisper. A local CodeRabbit rerun after those fixes hit the CLI rate limit (43-minute wait). The follow-up commits are covered by the GitHub CodeRabbit review on this PR.stagingmerge (coderabbit review --agent --committed, base73bb8d7b6): the first three attempts hit the shared rate limit (13, 5 and 3 minute waits). The fourth completed with 0 findings on all 13 changed files.Manual verification notes
[whisper: character="Maukie" text="..."]. Use Hide from AI to hide it from Maukie and the other character. Let Maukie reply, then use Peek Prompt on Maukie's reply. Confirm the whisper text appears at that point in the history with none of the narration around it.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)Docs changed:
docs/roleplay/getting-started.md,docs/chats/messages.md,CHANGELOG.md. Translation follow-up: #7197.UI evidence (if applicable)
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.