[PR #6396] [MERGED] fix: Roleplay continuation and persona dice targets #7161

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

📋 Pull Request Information

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

Base: staging ← Head: codex/roleplay-command-regressions


📝 Commits (4)

  • 73cea9d chore: start Roleplay command regression fixes
  • aa9caee Merge remote-tracking branch 'origin/staging' into codex/roleplay-command-regressions
  • 9320f85 fix: keep Roleplay continuations inline and allow persona dice targets
  • 76b59c1 fix: use native whitespace trimming for message continuation

📊 Changes

11 files changed (+300 additions, -62 deletions)

View changed files

📝 CHANGELOG.md (+3 -0)
📝 e2e/roleplay-commands.e2e.ts (+200 -16)
📝 packages/client/src/components/chat/ChatRoleplaySurface.tsx (+36 -26)
📝 packages/client/src/hooks/use-generate.ts (+16 -1)
📝 packages/client/src/stores/chat.store.ts (+13 -1)
📝 packages/server/src/routes/generate.routes.ts (+13 -2)
📝 packages/server/src/services/generation/roleplay-commands.ts (+1 -1)
📝 packages/server/src/services/generation/roleplay-summary-runtime.ts (+1 -15)
📝 packages/shared/src/index.ts (+1 -0)
➕ packages/shared/src/utils/message-continuation.ts (+12 -0)
📝 scripts/regressions/prompt.regression.ts (+4 -0)

📄 Description

Linked issue

Closes #6394.
Closes #6395.

Why this change

Roleplay /continue already sends the target message ID and saves into that reply, but its live text was rendered as a separate message. Empty sends should still create a new reply. Narrator dice commands also rejected the user persona because only bot characters were offered and resolved as targets.

What changed

  • Reuse the existing inline message renderer for continuations, retaining the original text, media, and separator preference across chat switching. Share the existing continuation-joining helper with persistence and retain the complete message through editor post-processing.
  • Add the selected persona to the existing dice target list and attribute resolver. This also supports character cards used as personas, without changing command audience permissions or accepting unknown/ambiguous names.
  • Extend existing browser regressions and add two Unreleased changelog entries. No dependencies or settings added.

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

Automated results: pnpm check, pnpm regression:prompt, and the existing Roleplay command Node regressions passed. Twenty-one focused browser checks passed across desktop Chromium, mobile Chromium, and mobile WebKit. After review adjustments, the continuation checks passed again in all three browsers, including a full-message editor SSE replay. After CodeQL flagged a legacy whitespace regex in the moved helper, native trimming replaced it; the prompt regressions (including whitespace preservation) and pnpm check passed again. The existing unrelated GameNarration hook-dependency lint warning remains.

The browser proof checks /continue, /cont, both newline preferences, empty sends, switching away during streaming, reloads, stored message IDs/counts, native and textual dice commands, persona attributes, inline dice after reload/translation, existing command permissions/private state, and VN regeneration. Baseline checks failed on the separate live continuation bubble and missing persona targets. Local CodeRabbit reviewed the initial ten-file patch; its one minor windowing finding was addressed by reopening the latest transcript window when an explicit continuation begins, while preserving hidden-message visibility.

Manual verification notes

  • Manually verify continuation in your usual Roleplay chat on desktop and a physical phone.
  • Manually verify Narrator dice commands targeting your persona name with your chosen model.
  • Manually verify continuation with your installed editor agents and existing media.

Claim boundary: generation and persistence tests use a deterministic local model endpoint; the editor case replays its full-message SSE contract rather than invoking an installed agent. Mobile checks use device emulation. Real external model behavior, downloadable editors, and physical devices were not exercised.

Docs and release impact

The Unreleased changelog includes both fixes. No user-facing labels, documentation, translations, dependencies, or release version files changed.

UI evidence (if applicable)

Before/after screenshots and regression/review logs.

Summary by CodeRabbit

  • New Features

    • Roleplay /continue and /cont commands now stream directly into the latest reply.
    • Continuing a message preserves roleplay context, including reasoning, attachments, dice results, and related metadata.
    • Roleplay dice rolls can target the user’s selected persona or character, in addition to other participants.
  • Bug Fixes

    • Improved continuation rendering, message persistence, stream interruption handling, and behavior when starting a new message.
    • Continuation text now maintains expected spacing and line breaks.

🔄 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/6396 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 9/19/2026 **Status:** ✅ Merged **Merged:** 9/20/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `codex/roleplay-command-regressions` --- ### 📝 Commits (4) - [`73cea9d`](https://github.com/Pasta-Devs/Marinara-Engine/commit/73cea9d2b1586450fa0c87f6eacf20ae0651f0b7) chore: start Roleplay command regression fixes - [`aa9caee`](https://github.com/Pasta-Devs/Marinara-Engine/commit/aa9caeed36f482932e3eec23d60169fbc1cdc8c7) Merge remote-tracking branch 'origin/staging' into codex/roleplay-command-regressions - [`9320f85`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9320f85f941e735f459593b8760d13c447d4b57a) fix: keep Roleplay continuations inline and allow persona dice targets - [`76b59c1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/76b59c18d39e9c3545e8d944db2784db879db892) fix: use native whitespace trimming for message continuation ### 📊 Changes **11 files changed** (+300 additions, -62 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+3 -0) 📝 `e2e/roleplay-commands.e2e.ts` (+200 -16) 📝 `packages/client/src/components/chat/ChatRoleplaySurface.tsx` (+36 -26) 📝 `packages/client/src/hooks/use-generate.ts` (+16 -1) 📝 `packages/client/src/stores/chat.store.ts` (+13 -1) 📝 `packages/server/src/routes/generate.routes.ts` (+13 -2) 📝 `packages/server/src/services/generation/roleplay-commands.ts` (+1 -1) 📝 `packages/server/src/services/generation/roleplay-summary-runtime.ts` (+1 -15) 📝 `packages/shared/src/index.ts` (+1 -0) ➕ `packages/shared/src/utils/message-continuation.ts` (+12 -0) 📝 `scripts/regressions/prompt.regression.ts` (+4 -0) </details> ### 📄 Description ## Linked issue Closes #6394. Closes #6395. ## Why this change Roleplay `/continue` already sends the target message ID and saves into that reply, but its live text was rendered as a separate message. Empty sends should still create a new reply. Narrator dice commands also rejected the user persona because only bot characters were offered and resolved as targets. ## What changed - Reuse the existing inline message renderer for continuations, retaining the original text, media, and separator preference across chat switching. Share the existing continuation-joining helper with persistence and retain the complete message through editor post-processing. - Add the selected persona to the existing dice target list and attribute resolver. This also supports character cards used as personas, without changing command audience permissions or accepting unknown/ambiguous names. - Extend existing browser regressions and add two Unreleased changelog entries. No dependencies or settings added. ## 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` Automated results: `pnpm check`, `pnpm regression:prompt`, and the existing Roleplay command Node regressions passed. Twenty-one focused browser checks passed across desktop Chromium, mobile Chromium, and mobile WebKit. After review adjustments, the continuation checks passed again in all three browsers, including a full-message editor SSE replay. After CodeQL flagged a legacy whitespace regex in the moved helper, native trimming replaced it; the prompt regressions (including whitespace preservation) and `pnpm check` passed again. The existing unrelated GameNarration hook-dependency lint warning remains. The browser proof checks `/continue`, `/cont`, both newline preferences, empty sends, switching away during streaming, reloads, stored message IDs/counts, native and textual dice commands, persona attributes, inline dice after reload/translation, existing command permissions/private state, and VN regeneration. Baseline checks failed on the separate live continuation bubble and missing persona targets. Local CodeRabbit reviewed the initial ten-file patch; its one minor windowing finding was addressed by reopening the latest transcript window when an explicit continuation begins, while preserving hidden-message visibility. ### Manual verification notes - [ ] Manually verify continuation in your usual Roleplay chat on desktop and a physical phone. - [ ] Manually verify Narrator dice commands targeting your persona name with your chosen model. - [ ] Manually verify continuation with your installed editor agents and existing media. Claim boundary: generation and persistence tests use a deterministic local model endpoint; the editor case replays its full-message SSE contract rather than invoking an installed agent. Mobile checks use device emulation. Real external model behavior, downloadable editors, and physical devices were not exercised. ## Docs and release impact The Unreleased changelog includes both fixes. No user-facing labels, documentation, translations, dependencies, or release version files changed. ## UI evidence (if applicable) [Before/after screenshots and regression/review logs](https://gist.github.com/SpicyMarinara/dd02d490e66bc6aecac6f6ed97994c76). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Roleplay `/continue` and `/cont` commands now stream directly into the latest reply. * Continuing a message preserves roleplay context, including reasoning, attachments, dice results, and related metadata. * Roleplay dice rolls can target the user’s selected persona or character, in addition to other participants. * **Bug Fixes** * Improved continuation rendering, message persistence, stream interruption handling, and behavior when starting a new message. * Continuation text now maintains expected spacing and line breaks. <!-- 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:17:06 +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#7161
No description provided.