[PR #6617] [MERGED] feat(roleplay): private inline whispers for characters and persona #7255

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

📋 Pull Request Information

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

Base: staging ← Head: codex/roleplay-whisper


📝 Commits (4)

  • abf1281 docs: track private roleplay whisper feature
  • eb31e83 feat(roleplay): add private inline whispers for characters and persona
  • 01cea4f Merge remote-tracking branch 'origin/staging' into codex/roleplay-whisper
  • 1f66a52 fix(roleplay): preserve whisper ordering and accessible reveal controls

📊 Changes

16 files changed (+879 additions, -97 deletions)

View changed files

📝 CHANGELOG.md (+2 -0)
📝 docs/roleplay/getting-started.md (+8 -0)
📝 e2e/roleplay-commands.e2e.ts (+177 -0)
📝 packages/client/src/components/chat/ChatMessage.tsx (+63 -31)
📝 packages/client/src/components/chat/RoleplayCommandResults.tsx (+87 -30)
📝 packages/client/src/components/chat/RoleplayCommandsSettings.tsx (+6 -4)
📝 packages/client/src/lib/dice-roll-result.ts (+6 -18)
📝 packages/client/src/localization/locales/en.json (+8 -1)
📝 packages/server/src/routes/generate.routes.ts (+36 -4)
📝 packages/server/src/routes/generate/conversation-prompt-formatting.ts (+5 -3)
📝 packages/server/src/routes/generate/dry-run-route.ts (+25 -2)
📝 packages/server/src/services/generation/roleplay-commands.ts (+87 -2)
📝 packages/shared/src/types/chat.ts (+1 -0)
📝 packages/shared/src/types/roleplay-command.ts (+51 -2)
📝 scripts/regressions/roleplay-commands.regression.ts (+55 -0)
➕ scripts/regressions/roleplay-whisper-generation.regression.ts (+262 -0)

📄 Description

Linked issue

Closes #6616

Why this change

Roleplay characters and narrators need to share a secret or vision with one recipient without teaching it to everyone in the chat. [whisper: character="name" text="the secret"] now keeps that fragment private in prompts and renders it where the command appeared.

What changed

  • Add an optional, default-off Whisper command with the existing All / Narrator permission selector. It supports solo chats and Individual group generation, including the selected persona as a recipient.
  • Resolve the recipient to a stable ID and keep the text out of public narration and shared agent prompts. Only the recipient and appointed narrator receive it in retained history, in both generation and Peek Prompt. Unknown or ambiguous names are discarded.
  • Reuse command activity records and dice-result positioning for inline secret blocks. Persona-addressed whispers appear immediately; other secrets have a Reveal a secret button. Reveal changes only the screen and resets on reload.
  • Preserve privacy across streaming, same-turn replies, impersonation, swipes, continuation, hidden messages, and saved reasoning. Merged group generation cannot receive or create private whispers.

Secrets follow the active message swipe and selected history; they are not copied into shared summaries or a separate durable memory store.

Validation

Agent-run verification:

  • pnpm check, pnpm version:check, and pnpm regression:prompt passed.
  • Roleplay command and real generation regressions passed, including recipient/narrator/persona isolation, one-character stream chunks, same-turn replies, preview parity, hidden messages, swipes, continuation, invalid recipients, and narrator-only/merged-mode gates.
  • Six whisper browser scenarios passed across desktop Chromium, mobile Chromium, and mobile WebKit, in Classic/dark and Visual Novel/light. Tests exercise settings, reveal/hide, placement, persona visibility, reload, secret-only replies, and prompt isolation after reveal.
  • Twenty-one existing notes, dice, document, swipe, and branch browser scenarios passed across the same browser projects.
  • Dockerfile.lite built and ran: health and UI returned HTTP 200; the compiled prompt helper passed recipient/narrator isolation checks.
  • Initial local CodeRabbit review completed with zero findings. Four hosted review findings were then addressed: prompt ordering (including repeated text and wrappers), Visual Novel separator positions, active-narrator preview parity, and reveal-button accessibility. The follow-up local review completed with zero findings. GitHub CI and review remain merge gates.
  • After the review corrections, pnpm check, pnpm regression:prompt, the command/generation regressions, and 18 whisper/dice browser scenarios passed again. All required GitHub checks and the hosted CodeRabbit review passed on 1f66a52cf before merging to staging as dd876831a. The broader regression/platform reruns were still in progress at merge; the previous complete regression matrix passed on 01cea4f7a.

The advisory docstring-coverage check was inconclusive. Privacy and positioning rules are documented at their helpers and in the user guide; existing self-explanatory functions were not padded with boilerplate to meet a percentage target.

Human checklist (left unchecked):

  • 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

Manually verify the Whisper toggle and All / Narrator selector in Chat Settings → Agents → Commands. Generate a whisper to another character and one to your persona; confirm their positions (including between paragraphs), reveal/hide behavior, and their order in each character's Peek Prompt. Check Classic and Visual Novel on desktop and mobile. Automated browser evidence above is separate from this human checklist.

Docs and release impact

Updated the Roleplay getting-started guide, canonical English UI catalog, and Unreleased changelog. Translated documentation follow-up: #6619. No version bump.

  • 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
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

Default-off settings and concealed/revealed screenshots, including desktop/mobile, light/dark, Classic/Visual Novel, and persona visibility. Download the self-contained HTML to view the original PNG screenshots; fixtures contain synthetic data only.


🔄 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/6617 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 9/24/2026 **Status:** ✅ Merged **Merged:** 9/24/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `codex/roleplay-whisper` --- ### 📝 Commits (4) - [`abf1281`](https://github.com/Pasta-Devs/Marinara-Engine/commit/abf1281e2a57dfac37c3a4bdd2662efa090dad48) docs: track private roleplay whisper feature - [`eb31e83`](https://github.com/Pasta-Devs/Marinara-Engine/commit/eb31e833ba89d5e9fd190043d5e5ff56ebcff06e) feat(roleplay): add private inline whispers for characters and persona - [`01cea4f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/01cea4f7a653735d7cdce8fd849e73f442e20ed5) Merge remote-tracking branch 'origin/staging' into codex/roleplay-whisper - [`1f66a52`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1f66a52cf2ccf43cbd9ce48288af6de69632b45f) fix(roleplay): preserve whisper ordering and accessible reveal controls ### 📊 Changes **16 files changed** (+879 additions, -97 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+2 -0) 📝 `docs/roleplay/getting-started.md` (+8 -0) 📝 `e2e/roleplay-commands.e2e.ts` (+177 -0) 📝 `packages/client/src/components/chat/ChatMessage.tsx` (+63 -31) 📝 `packages/client/src/components/chat/RoleplayCommandResults.tsx` (+87 -30) 📝 `packages/client/src/components/chat/RoleplayCommandsSettings.tsx` (+6 -4) 📝 `packages/client/src/lib/dice-roll-result.ts` (+6 -18) 📝 `packages/client/src/localization/locales/en.json` (+8 -1) 📝 `packages/server/src/routes/generate.routes.ts` (+36 -4) 📝 `packages/server/src/routes/generate/conversation-prompt-formatting.ts` (+5 -3) 📝 `packages/server/src/routes/generate/dry-run-route.ts` (+25 -2) 📝 `packages/server/src/services/generation/roleplay-commands.ts` (+87 -2) 📝 `packages/shared/src/types/chat.ts` (+1 -0) 📝 `packages/shared/src/types/roleplay-command.ts` (+51 -2) 📝 `scripts/regressions/roleplay-commands.regression.ts` (+55 -0) ➕ `scripts/regressions/roleplay-whisper-generation.regression.ts` (+262 -0) </details> ### 📄 Description ## Linked issue Closes #6616 ## Why this change Roleplay characters and narrators need to share a secret or vision with one recipient without teaching it to everyone in the chat. `[whisper: character="name" text="the secret"]` now keeps that fragment private in prompts and renders it where the command appeared. ## What changed - Add an optional, default-off Whisper command with the existing All / Narrator permission selector. It supports solo chats and Individual group generation, including the selected persona as a recipient. - Resolve the recipient to a stable ID and keep the text out of public narration and shared agent prompts. Only the recipient and appointed narrator receive it in retained history, in both generation and Peek Prompt. Unknown or ambiguous names are discarded. - Reuse command activity records and dice-result positioning for inline secret blocks. Persona-addressed whispers appear immediately; other secrets have a **Reveal a secret** button. Reveal changes only the screen and resets on reload. - Preserve privacy across streaming, same-turn replies, impersonation, swipes, continuation, hidden messages, and saved reasoning. Merged group generation cannot receive or create private whispers. Secrets follow the active message swipe and selected history; they are not copied into shared summaries or a separate durable memory store. ## Validation Agent-run verification: - `pnpm check`, `pnpm version:check`, and `pnpm regression:prompt` passed. - Roleplay command and real generation regressions passed, including recipient/narrator/persona isolation, one-character stream chunks, same-turn replies, preview parity, hidden messages, swipes, continuation, invalid recipients, and narrator-only/merged-mode gates. - Six whisper browser scenarios passed across desktop Chromium, mobile Chromium, and mobile WebKit, in Classic/dark and Visual Novel/light. Tests exercise settings, reveal/hide, placement, persona visibility, reload, secret-only replies, and prompt isolation after reveal. - Twenty-one existing notes, dice, document, swipe, and branch browser scenarios passed across the same browser projects. - `Dockerfile.lite` built and ran: health and UI returned HTTP 200; the compiled prompt helper passed recipient/narrator isolation checks. - Initial local CodeRabbit review completed with zero findings. Four hosted review findings were then addressed: prompt ordering (including repeated text and wrappers), Visual Novel separator positions, active-narrator preview parity, and reveal-button accessibility. The follow-up local review completed with zero findings. GitHub CI and review remain merge gates. - After the review corrections, `pnpm check`, `pnpm regression:prompt`, the command/generation regressions, and 18 whisper/dice browser scenarios passed again. All required GitHub checks and the hosted CodeRabbit review passed on `1f66a52cf` before merging to `staging` as `dd876831a`. The broader regression/platform reruns were still in progress at merge; the previous complete regression matrix passed on `01cea4f7a`. The advisory docstring-coverage check was inconclusive. Privacy and positioning rules are documented at their helpers and in the user guide; existing self-explanatory functions were not padded with boilerplate to meet a percentage target. Human checklist (left unchecked): - [ ] `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 Manually verify the Whisper toggle and All / Narrator selector in Chat Settings → Agents → Commands. Generate a whisper to another character and one to your persona; confirm their positions (including between paragraphs), reveal/hide behavior, and their order in each character's Peek Prompt. Check Classic and Visual Novel on desktop and mobile. Automated browser evidence above is separate from this human checklist. ## Docs and release impact Updated the Roleplay getting-started guide, canonical English UI catalog, and Unreleased changelog. Translated documentation follow-up: #6619. No version bump. - [ ] 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 - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) [Default-off settings and concealed/revealed screenshots](https://gist.github.com/SpicyMarinara/db4f08f7d31f6186633afa519ddc5896), including desktop/mobile, light/dark, Classic/Visual Novel, and persona visibility. Download the self-contained HTML to view the original PNG screenshots; fixtures contain synthetic data only. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:17:58 +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#7255
No description provided.