[PR #6878] [MERGED] feat(roleplay): editable whispers, user private commands and Smart trigger #7364

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

📋 Pull Request Information

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

Base: staging ← Head: codex/group-roleplay-controls


📝 Commits (3)

  • 5c6e86f chore: start roleplay group controls work for #6877
  • 435a8fa feat(roleplay): edit whispers and add user private commands and Smart trigger
  • cd070f5 fix(roleplay): resume autoplay after closing the whisper editor

📊 Changes

30 files changed (+1652 additions, -115 deletions)

View changed files

📝 CHANGELOG.md (+2 -0)
📝 docs/chats/group-chats.md (+2 -0)
📝 docs/roleplay/getting-started.md (+10 -0)
📝 e2e/roleplay-commands.e2e.ts (+290 -8)
📝 packages/client/src/components/chat/ChatInput.tsx (+17 -5)
📝 packages/client/src/components/chat/ChatMessage.tsx (+37 -15)
📝 packages/client/src/components/chat/ChatRoleplaySurface.tsx (+5 -3)
📝 packages/client/src/components/chat/RoleplayCommandResults.tsx (+120 -20)
📝 packages/client/src/components/ui/ExpandedTextarea.tsx (+1 -0)
📝 packages/client/src/hooks/use-generate.ts (+1 -0)
📝 packages/client/src/lib/chat-message-visibility.ts (+2 -0)
📝 packages/client/src/localization/locales/en.json (+5 -0)
📝 packages/server/src/routes/chats.routes.ts (+1 -1)
📝 packages/server/src/routes/generate.routes.ts (+26 -4)
📝 packages/server/src/routes/generate/conversation-prompt-formatting.ts (+5 -0)
📝 packages/server/src/routes/generate/dry-run-route.ts (+33 -12)
📝 packages/server/src/services/advanced-memory.ts (+12 -5)
📝 packages/server/src/services/generation/roleplay-commands.ts (+106 -15)
📝 packages/server/src/services/generation/roleplay-summary-runtime.ts (+14 -2)
📝 packages/server/src/services/memory-recall.ts (+19 -2)

...and 10 more files

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #6877

Why this change

Roleplayers need to correct revealed whispers, write their own private whispers and notes, and ask Smart to choose a speaker without changing a Manual group's saved response order. The narrator must also stop receiving notes from characters who have been disabled or removed.

What changed

  • Reuse the existing message/swipe metadata editor for revealed whispers. Save keeps the recipient and original command, persists across reloads, and supplies the correction to later prompts. Failed saves retain the draft; visual-novel autoplay and TTS paragraph following pause while editing.
  • Add Smart as the first trigger-menu item in Individual Roleplay groups using Smart or Manual order, with the existing people icon in the app accent. Reuse the existing selector and optional Decision model for that turn without changing chat settings.
  • Parse user [whisper] and [notes] commands on normal Roleplay message creation, edits and imports. Keep public prose separate from private per-swipe activities; use the existing notes editor and recipient/narrator prompt injection. Command-only and rejected-command messages remain visible, with original invalid text available for recovery.
  • Exclude inactive or removed characters' personal state from the narrator's current prompt without deleting saved notes. Strip private user tags from shared summary/memory inputs, including old cached raw excerpts.

This works in ordinary local Roleplay chats; multiplayer does not need to be enabled. It reuses existing commands, storage, editors and generation paths, with no new dependency or storage format.

Validation

Validated implementation commit 435a8faa055d9001b8f5c21beaed9d794f546d57:

  • pnpm check — passed (localization, format, lint, types and production build).
  • pnpm regression:prompt — passed. Roleplay Node subset: 12/12 passed; after the final parser review fix, private storage/generation/memory subset: 3/3 passed. Existing Smart/mention/group-prompt, memory-recall/Advanced Memory and visibility regressions also passed.
  • Focused roleplay-commands.e2e.ts cases on desktop Chromium, mobile Chromium and mobile WebKit — Smart/whisper flows 12/12 passed; user-command flows 3/3 passed after fixing command-only message visibility. Includes cancel/empty/retry/reload, classic/VN, disabled/invalid commands and private audience assertions.
  • pnpm smoke:ui — 7/7 passed. pnpm smoke:production — 3/3 passed.
  • Full Docker image built; node scripts/smoke-container.mjs marinara-group-roleplay-controls:local full arm64 — passed API/frontend/native binding and persistence across container replacement.
  • Local CodeRabbit: one valid minor parser finding fixed (preserve ordinary unfinished [n text); follow-up review completed with zero findings. Independent integration review fixes are covered by regressions.

Review follow-up cd070f5da7fa55eefeca74fbdb46761d7c4f9409: fixed the valid GitHub review finding so VN autoplay resumes after the editor closes. Re-ran pnpm check, all three VN browser cases (including automatic resumption after Cancel), UI smoke 7/7, production smoke 3/3, and Docker build/runtime checks; all passed. Focused local CodeRabbit review completed with zero findings. The translation comment is covered by existing #6879. GitHub's complete Node regression lane and platform artifact matrix also passed on the implementation commit; final-commit CI is tracked below by GitHub.

  • 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 revealed whisper edit/save/cancel/reload on your desktop and mobile devices, including a failed save and visual-novel autoplay.
  • Manually verify Smart and named-character triggers with both Smart and Manual saved order, with the Decision model on and off.
  • Manually send [whisper: character="Bob" text="a secret"] and [notes: content="a private intention"] in an ordinary Roleplay chat with those commands enabled. Inspect recipient, other-character and narrator prompts; disable/remove/re-enable a character and inspect narrator notes.

Automated route/provider tests and Playwright browser results are reported separately from this human checklist. Browser device profiles are not physical iPhone/Android testing. Privacy here concerns model audiences; original command data remains in the owner's local history/export. Existing prose or paraphrased summaries are not retroactively rewritten.

Review disposition: the architecture summary identifies the existing command editor’s last-write-wins behavior across stale tabs/devices. Whisper Save uses the current message props, but the shared metadata endpoint replaces the supplied activity array, as notes/memory/document editors already did on the staging base. Concurrent cross-tab edits are not conflict-protected. A shared atomic activity update or version guard is a separate follow-up; a whisper-only refetch would not eliminate the race.

Docs and release impact

Updated the Roleplay getting-started and group-chat guides, canonical English UI strings and [Unreleased] changelog. Translation follow-up: #6879. 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 (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

Before/after desktop and iPhone-sized browser screenshots: download the HTML file and open it to view the embedded PNGs. Includes Smart placement/accent, revealed/edited whispers, mobile save-error recovery, and user notes. Baseline screenshots use staging c4a695eb6. No generated evidence images are committed.


🔄 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/6878 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 9/29/2026 **Status:** ✅ Merged **Merged:** 9/30/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `codex/group-roleplay-controls` --- ### 📝 Commits (3) - [`5c6e86f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5c6e86fe6ca9da54c63d4664687a5b7fa90d2270) chore: start roleplay group controls work for #6877 - [`435a8fa`](https://github.com/Pasta-Devs/Marinara-Engine/commit/435a8faa055d9001b8f5c21beaed9d794f546d57) feat(roleplay): edit whispers and add user private commands and Smart trigger - [`cd070f5`](https://github.com/Pasta-Devs/Marinara-Engine/commit/cd070f5da7fa55eefeca74fbdb46761d7c4f9409) fix(roleplay): resume autoplay after closing the whisper editor ### 📊 Changes **30 files changed** (+1652 additions, -115 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+2 -0) 📝 `docs/chats/group-chats.md` (+2 -0) 📝 `docs/roleplay/getting-started.md` (+10 -0) 📝 `e2e/roleplay-commands.e2e.ts` (+290 -8) 📝 `packages/client/src/components/chat/ChatInput.tsx` (+17 -5) 📝 `packages/client/src/components/chat/ChatMessage.tsx` (+37 -15) 📝 `packages/client/src/components/chat/ChatRoleplaySurface.tsx` (+5 -3) 📝 `packages/client/src/components/chat/RoleplayCommandResults.tsx` (+120 -20) 📝 `packages/client/src/components/ui/ExpandedTextarea.tsx` (+1 -0) 📝 `packages/client/src/hooks/use-generate.ts` (+1 -0) 📝 `packages/client/src/lib/chat-message-visibility.ts` (+2 -0) 📝 `packages/client/src/localization/locales/en.json` (+5 -0) 📝 `packages/server/src/routes/chats.routes.ts` (+1 -1) 📝 `packages/server/src/routes/generate.routes.ts` (+26 -4) 📝 `packages/server/src/routes/generate/conversation-prompt-formatting.ts` (+5 -0) 📝 `packages/server/src/routes/generate/dry-run-route.ts` (+33 -12) 📝 `packages/server/src/services/advanced-memory.ts` (+12 -5) 📝 `packages/server/src/services/generation/roleplay-commands.ts` (+106 -15) 📝 `packages/server/src/services/generation/roleplay-summary-runtime.ts` (+14 -2) 📝 `packages/server/src/services/memory-recall.ts` (+19 -2) _...and 10 more files_ </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Closes #6877 ## Why this change Roleplayers need to correct revealed whispers, write their own private whispers and notes, and ask Smart to choose a speaker without changing a Manual group's saved response order. The narrator must also stop receiving notes from characters who have been disabled or removed. ## What changed - Reuse the existing message/swipe metadata editor for revealed whispers. Save keeps the recipient and original command, persists across reloads, and supplies the correction to later prompts. Failed saves retain the draft; visual-novel autoplay and TTS paragraph following pause while editing. - Add **Smart** as the first trigger-menu item in Individual Roleplay groups using Smart or Manual order, with the existing people icon in the app accent. Reuse the existing selector and optional Decision model for that turn without changing chat settings. - Parse user `[whisper]` and `[notes]` commands on normal Roleplay message creation, edits and imports. Keep public prose separate from private per-swipe activities; use the existing notes editor and recipient/narrator prompt injection. Command-only and rejected-command messages remain visible, with original invalid text available for recovery. - Exclude inactive or removed characters' personal state from the narrator's current prompt without deleting saved notes. Strip private user tags from shared summary/memory inputs, including old cached raw excerpts. This works in ordinary local Roleplay chats; multiplayer does not need to be enabled. It reuses existing commands, storage, editors and generation paths, with no new dependency or storage format. ## Validation Validated implementation commit `435a8faa055d9001b8f5c21beaed9d794f546d57`: - `pnpm check` — passed (localization, format, lint, types and production build). - `pnpm regression:prompt` — passed. Roleplay Node subset: 12/12 passed; after the final parser review fix, private storage/generation/memory subset: 3/3 passed. Existing Smart/mention/group-prompt, memory-recall/Advanced Memory and visibility regressions also passed. - Focused `roleplay-commands.e2e.ts` cases on desktop Chromium, mobile Chromium and mobile WebKit — Smart/whisper flows 12/12 passed; user-command flows 3/3 passed after fixing command-only message visibility. Includes cancel/empty/retry/reload, classic/VN, disabled/invalid commands and private audience assertions. - `pnpm smoke:ui` — 7/7 passed. `pnpm smoke:production` — 3/3 passed. - Full Docker image built; `node scripts/smoke-container.mjs marinara-group-roleplay-controls:local full arm64` — passed API/frontend/native binding and persistence across container replacement. - Local CodeRabbit: one valid minor parser finding fixed (preserve ordinary unfinished `[n` text); follow-up review completed with zero findings. Independent integration review fixes are covered by regressions. Review follow-up `cd070f5da7fa55eefeca74fbdb46761d7c4f9409`: fixed the valid GitHub review finding so VN autoplay resumes after the editor closes. Re-ran `pnpm check`, all three VN browser cases (including automatic resumption after Cancel), UI smoke 7/7, production smoke 3/3, and Docker build/runtime checks; all passed. Focused local CodeRabbit review completed with zero findings. The translation comment is covered by existing #6879. GitHub's complete Node regression lane and platform artifact matrix also passed on the implementation commit; final-commit CI is tracked below by GitHub. - [ ] `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 revealed whisper edit/save/cancel/reload on your desktop and mobile devices, including a failed save and visual-novel autoplay. - Manually verify Smart and named-character triggers with both Smart and Manual saved order, with the Decision model on and off. - Manually send `[whisper: character="Bob" text="a secret"]` and `[notes: content="a private intention"]` in an ordinary Roleplay chat with those commands enabled. Inspect recipient, other-character and narrator prompts; disable/remove/re-enable a character and inspect narrator notes. Automated route/provider tests and Playwright browser results are reported separately from this human checklist. Browser device profiles are not physical iPhone/Android testing. Privacy here concerns model audiences; original command data remains in the owner's local history/export. Existing prose or paraphrased summaries are not retroactively rewritten. Review disposition: the architecture summary identifies the existing command editor’s last-write-wins behavior across stale tabs/devices. Whisper Save uses the current message props, but the shared metadata endpoint replaces the supplied activity array, as notes/memory/document editors already did on the staging base. Concurrent cross-tab edits are not conflict-protected. A shared atomic activity update or version guard is a separate follow-up; a whisper-only refetch would not eliminate the race. ## Docs and release impact Updated the Roleplay getting-started and group-chat guides, canonical English UI strings and `[Unreleased]` changelog. Translation follow-up: #6879. 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 (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) [Before/after desktop and iPhone-sized browser screenshots](https://gist.github.com/SpicyMarinara/9f70b2daabab1ae9bba57ad83e0180be): download the HTML file and open it to view the embedded PNGs. Includes Smart placement/accent, revealed/edited whispers, mobile save-error recovery, and user notes. Baseline screenshots use staging `c4a695eb6`. No generated evidence images are committed. --- <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:02 +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#7364
No description provided.