mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #6110] [MERGED] feat: add reversible Roleplay interruption #7064
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#7064
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/6110
Author: @SpicyMarinara
Created: 9/12/2026
Status: ✅ Merged
Merged: 9/12/2026
Merged by: @SpicyMarinara
Base:
staging← Head:feat/roleplay-interrupt📝 Commits (3)
bc00354chore: track roleplay interrupt implementation3e8cb6bfeat: add reversible Roleplay interruption command51dfc8dfix: refresh restored interruption swipes and gate prompt availability📊 Changes
20 files changed (+1875 additions, -50 deletions)
View changed files
📝
CHANGELOG.md(+3 -0)📝
docs/roleplay/getting-started.md(+8 -0)📝
e2e/roleplay-commands.e2e.ts(+214 -0)📝
packages/client/src/components/chat/RoleplayCommandResults.tsx(+43 -3)📝
packages/client/src/hooks/use-chats.ts(+17 -0)📝
packages/client/src/hooks/use-generate.ts(+16 -0)➕
packages/client/src/hooks/use-roleplay-commands.ts(+48 -0)📝
packages/client/src/localization/locales/en.json(+5 -0)📝
packages/server/src/routes/chats.routes.ts(+100 -32)📝
packages/server/src/routes/generate.routes.ts(+134 -7)📝
packages/server/src/routes/index.ts(+2 -0)📝
packages/server/src/services/generation/roleplay-commands.ts(+9 -0)➕
packages/server/src/services/generation/roleplay-interrupt-context.ts(+46 -0)➕
packages/server/src/services/generation/roleplay-interrupt.ts(+63 -0)📝
packages/server/src/services/import/st-chat.importer.ts(+1 -0)📝
packages/server/src/services/storage/chats.storage.ts(+375 -7)📝
packages/shared/src/types/roleplay-command.ts(+12 -1)📝
scripts/regressions/roleplay-commands.regression.ts(+81 -0)➕
scripts/regressions/roleplay-interrupt-generation.regression.ts(+317 -0)➕
scripts/regressions/roleplay-interrupt-storage.regression.ts(+381 -0)📄 Description
Linked issue
Closes #6109
Why this change
Roleplay characters need a reversible way to interrupt the latest dialogue or action before the rest happens. The original message must remain recoverable, and rerolls must receive its full content.
What changed
Validation
pnpm install --frozen-lockfilecompleted.pnpm checkandpnpm regression:promptpassed, including localization, TypeScript, lint, and builds.Focused command, interruption storage, and real generation-route regressions passed. They cover literal/ambiguous matching, escaped regex punctuation, dialogue/actions, opt-out and visibility gates, full original reroll prompts, failed/cancelled rerolls, cancellation during saving and queued commits, active-generation Restore conflicts, and consecutive user/character cuts in a three-character group with Advanced Memory enabled.
Storage proof also covers later edits, swipe renumbering, deletion, transaction rollback, branch/JSONL recovery, and bounded ordinary bulk-deletion reads. Existing message-mutation-race and branch-lineage regressions passed.
Focused
pnpm smoke:ui e2e/roleplay-commands.e2e.ts --grep 'Roleplay interruptions'passed: desktop Chromium 1/1, mobile Chromium + WebKit 2/2. It exercises the default-off toggle, real generation/SSE cut, keyboard disclosure, themed text, pending Restore, reload persistence, and later manual-edit conflict.pnpm checkpasses locallyContainer (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.mdManual verification notes
Docs and release impact
Updated
CHANGELOG.mdanddocs/roleplay/getting-started.md. Translated documentation follow-up: #6111. No new dependency, schema migration, or version bump.The automated model fixture verifies Engine behavior; a live model's decision to interrupt and physical-phone interaction remain manual verification items above.
UI evidence (if applicable)
Synthetic browser screenshots: settings before/after enabling Interruptions and the cut dialogue with Restore, in light/dark themes on all three browsers. These use isolated fixture data and viewport emulation.
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.