[PR #6920] [MERGED] fix(roleplay): turn whispers typed into edited replies into whispers #7383

Closed
opened 2026-10-23 04:19:14 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/6920
Author: @SpicyMarinara
Created: 9/30/2026
Status: ✅ Merged
Merged: 9/30/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/roleplay-private-history-parts


📝 Commits (1)

  • a3879ae fix(roleplay): turn whispers typed into edited replies into whispers

📊 Changes

9 files changed (+98 additions, -5 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 docs/roleplay/getting-started.md (+2 -0)
📝 e2e/roleplay-commands.e2e.ts (+24 -0)
📝 packages/client/src/localization/locales/en.json (+1 -1)
📝 packages/server/src/routes/chats.routes.ts (+1 -1)
📝 packages/server/src/services/generation/roleplay-commands.ts (+1 -1)
📝 packages/server/src/services/storage/chats.storage.ts (+9 -2)
📝 scripts/regressions/roleplay-commands.regression.ts (+25 -0)
📝 scripts/regressions/roleplay-user-private-generation.regression.ts (+34 -0)

📄 Description

Fixes #6918

Why this change

In a Roleplay group chat, editing the narrator's message to add [whisper: character="Maukie" text="..."] saved the tag as plain text. It didn't become a whisper, so the part meant only for Maukie reached every character, and the message showed the raw tag instead of a whisper field.

The same command already worked in your own messages and in replies the model writes. updateMessageContent turned typed private tags (whisper, notes) into command records only for user messages.

The maintainer also asked for whispered dialogue to keep its quotes, like text=""I love you."", with real line breaks allowed, and for the prompt to say so.

What changed

  • Edits: the message edit route (PATCH /chats/:chatId/messages/:messageId) now passes { authored: true } to updateMessageContent. That runs the existing user-tag preparer, prepareUserRoleplayCommands, for character and narrator messages in Roleplay chats too. So a typed whisper becomes the message's whisper, with its recipient and position, like one the model wrote.
    • Existing command records and legacy documents are carried over exactly as for your own messages.
    • Generation paths (continue, corrections, rewrite agents, tool resolution) call updateMessageContent without the flag, so model text with bracketed prose is never reinterpreted as a typed tag. A regression checks this.
  • Quotes and line breaks: the parser already accepted plain quotes and real line breaks in whisper text; new regressions pin that, including streaming split at every character. The model-facing whisper description and the in-app description (roleplay.commands.whisper.description) now say the text may span several lines and quote dialogue as is.
  • Docs: docs/roleplay/getting-started.md gains one sentence covering whispers typed while editing a character's or the narrator's message, plus the quoting note. The translation follow-up is #6919.
  • Not changed: {{char}} inside earlier messages still resolves to that message's author, as the maintainer decided. A greeting that says "{{char}} waves" keeps its own character's name in every prompt.

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

Manual verification notes

Agent-run results (not substitutes for the checklist above):

  • pnpm check passes, as does pnpm regression:prompt (prompt, prompt-attachments, context-fit).
  • All 14 Roleplay regressions pass, including roleplay-commands, the user-private generation, memory and storage tests, whisper generation, interrupts, VN, message-trash and group-prompt-regex.
  • roleplay-user-private-generation: a whisper typed while editing the narrator's reply, with nested quotes and a line break, becomes Bob's whisper. It appears only in Bob's prompt, not Alice's, and a generated rewrite keeps [notes about the harbor] as prose. It fails without the route flag.
  • e2e/roleplay-commands.e2e.ts ("Roleplay users send and edit private whispers and notes"): edits a narrator reply through the real editor, then checks the whisper field appears (no raw tag remains), reveals the quoted, multi-line text, and checks Bob's and Alice's prompts. It passes on desktop Chromium, mobile Chromium and mobile WebKit, and fails at the whisper field without the fix.
  • The whole e2e/roleplay-commands.e2e.ts file passes 20/20 on desktop Chromium.
  • Local CodeRabbit reviewed all 9 files with 0 findings.

To check by hand:

  • In a Roleplay group chat with whispers enabled, edit the narrator's message to add [whisper: character="<name>" text=""Hello." And a second line."] (with a real line break), save, and confirm it shows as a whisper field.
  • Peek the prompt for that character and for another character, and confirm only the recipient (and the appointed narrator) receives the text.
  • Check that an edit with ordinary bracketed text (no [whisper/[notes) saves unchanged.

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)

The CHANGELOG entry and the Roleplay guide sentence are included; the translation follow-up is #6919.

UI evidence (if applicable)

The e2e run covers the edited narrator message showing a whisper field (concealed, then revealed) on desktop and mobile.

Summary by CodeRabbit

  • New Features
    • Whisper commands can now be used when editing character or narrator messages. After saving, the command becomes a whisper rather than appearing as literal text.
    • Whisper text can span multiple lines and include quoted dialogue.
    • Whispers appear in prompt previews for their intended recipient, not for others.
  • Documentation
    • Updated the getting-started guide and command description with the expanded whisper behavior and examples.

🔄 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/6920 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 9/30/2026 **Status:** ✅ Merged **Merged:** 9/30/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/roleplay-private-history-parts` --- ### 📝 Commits (1) - [`a3879ae`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a3879ae9485cbf36c708756a6a3ed5a4733a4472) fix(roleplay): turn whispers typed into edited replies into whispers ### 📊 Changes **9 files changed** (+98 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `docs/roleplay/getting-started.md` (+2 -0) 📝 `e2e/roleplay-commands.e2e.ts` (+24 -0) 📝 `packages/client/src/localization/locales/en.json` (+1 -1) 📝 `packages/server/src/routes/chats.routes.ts` (+1 -1) 📝 `packages/server/src/services/generation/roleplay-commands.ts` (+1 -1) 📝 `packages/server/src/services/storage/chats.storage.ts` (+9 -2) 📝 `scripts/regressions/roleplay-commands.regression.ts` (+25 -0) 📝 `scripts/regressions/roleplay-user-private-generation.regression.ts` (+34 -0) </details> ### 📄 Description Fixes #6918 ## Why this change In a Roleplay group chat, editing the narrator's message to add `[whisper: character="Maukie" text="..."]` saved the tag as plain text. It didn't become a whisper, so the part meant only for Maukie reached every character, and the message showed the raw tag instead of a whisper field. The same command already worked in your own messages and in replies the model writes. `updateMessageContent` turned typed private tags (`whisper`, `notes`) into command records only for user messages. The maintainer also asked for whispered dialogue to keep its quotes, like `text=""I love you.""`, with real line breaks allowed, and for the prompt to say so. ## What changed - **Edits:** the message edit route (`PATCH /chats/:chatId/messages/:messageId`) now passes `{ authored: true }` to `updateMessageContent`. That runs the existing user-tag preparer, `prepareUserRoleplayCommands`, for character and narrator messages in Roleplay chats too. So a typed whisper becomes the message's whisper, with its recipient and position, like one the model wrote. - Existing command records and legacy documents are carried over exactly as for your own messages. - Generation paths (continue, corrections, rewrite agents, tool resolution) call `updateMessageContent` without the flag, so model text with bracketed prose is never reinterpreted as a typed tag. A regression checks this. - **Quotes and line breaks:** the parser already accepted plain quotes and real line breaks in whisper text; new regressions pin that, including streaming split at every character. The model-facing whisper description and the in-app description (`roleplay.commands.whisper.description`) now say the text may span several lines and quote dialogue as is. - **Docs:** `docs/roleplay/getting-started.md` gains one sentence covering whispers typed while editing a character's or the narrator's message, plus the quoting note. The translation follow-up is #6919. - **Not changed:** `{{char}}` inside earlier messages still resolves to that message's author, as the maintainer decided. A greeting that says "`{{char}}` waves" keeps its own character's name in every prompt. ## 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` ### Manual verification notes Agent-run results (not substitutes for the checklist above): - `pnpm check` passes, as does `pnpm regression:prompt` (prompt, prompt-attachments, context-fit). - All 14 Roleplay regressions pass, including roleplay-commands, the user-private generation, memory and storage tests, whisper generation, interrupts, VN, message-trash and group-prompt-regex. - **`roleplay-user-private-generation`:** a whisper typed while editing the narrator's reply, with nested quotes and a line break, becomes Bob's whisper. It appears only in Bob's prompt, not Alice's, and a generated rewrite keeps `[notes about the harbor]` as prose. It fails without the route flag. - **`e2e/roleplay-commands.e2e.ts`** ("Roleplay users send and edit private whispers and notes"): edits a narrator reply through the real editor, then checks the whisper field appears (no raw tag remains), reveals the quoted, multi-line text, and checks Bob's and Alice's prompts. It passes on desktop Chromium, mobile Chromium and mobile WebKit, and fails at the whisper field without the fix. - The whole `e2e/roleplay-commands.e2e.ts` file passes 20/20 on desktop Chromium. - Local CodeRabbit reviewed all 9 files with 0 findings. To check by hand: - In a Roleplay group chat with whispers enabled, edit the narrator's message to add `[whisper: character="<name>" text=""Hello." And a second line."]` (with a real line break), save, and confirm it shows as a whisper field. - Peek the prompt for that character and for another character, and confirm only the recipient (and the appointed narrator) receives the text. - Check that an edit with ordinary bracketed text (no `[whisper`/`[notes`) saves unchanged. ## 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) The CHANGELOG entry and the Roleplay guide sentence are included; the translation follow-up is #6919. ## UI evidence (if applicable) The e2e run covers the edited narrator message showing a whisper field (concealed, then revealed) on desktop and mobile. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Whisper commands can now be used when editing character or narrator messages. After saving, the command becomes a whisper rather than appearing as literal text. * Whisper text can span multiple lines and include quoted dialogue. * Whispers appear in prompt previews for their intended recipient, not for others. * **Documentation** * Updated the getting-started guide and command description with the expanded whisper behavior and examples. <!-- 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-23 04:19:14 +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#7383
No description provided.