[PR #5991] [MERGED] feat(roleplay): refine command controls, activity and agent integration #7018

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

📋 Pull Request Information

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

Base: staging ← Head: feat/roleplay-command-refinements


📝 Commits (4)

  • fc89099 test(roleplay): require concise command instructions
  • ec87904 feat(roleplay): refine command controls and swipe-scoped activity
  • b284ea7 fix(roleplay): calibrate editor inset and align regression proof
  • 2adb161 fix(roleplay): separate selector names from descriptions

📊 Changes

21 files changed (+1310 additions, -214 deletions)

View changed files

📝 CHANGELOG.md (+2 -0)
📝 e2e/roleplay-commands.e2e.ts (+378 -22)
📝 packages/client/src/components/chat/ChatMessage.tsx (+8 -1)
📝 packages/client/src/components/chat/ChatRoleplaySurface.tsx (+2 -0)
📝 packages/client/src/components/chat/RoleplayCommandResults.tsx (+220 -31)
📝 packages/client/src/components/chat/RoleplayCommandsSettings.tsx (+101 -45)
📝 packages/client/src/hooks/use-chats.ts (+15 -4)
📝 packages/client/src/hooks/use-generate.ts (+2 -9)
📝 packages/client/src/localization/locales/en.json (+26 -3)
📝 packages/server/src/routes/chats.routes.ts (+11 -2)
📝 packages/server/src/routes/generate.routes.ts (+191 -63)
📝 packages/server/src/routes/generate/conversation-prompt-formatting.ts (+2 -2)
📝 packages/server/src/routes/generate/dry-run-route.ts (+8 -0)
📝 packages/server/src/services/generation/illustrator-manual-prompt-generation.ts (+4 -0)
📝 packages/server/src/services/generation/roleplay-commands.ts (+42 -27)
➕ packages/server/src/services/generation/roleplay-rolls.ts (+48 -0)
📝 packages/server/src/services/tools/tool-executor.ts (+3 -1)
📝 packages/shared/src/types/chat.ts (+11 -1)
📝 packages/shared/src/types/roleplay-command.ts (+98 -0)
📝 scripts/regressions/maintenance-lifecycle.regression.ts (+3 -2)

...and 1 more files

📄 Description

Linked issue

Closes #5990. Owner: @SpicyMarinara.

Why this change

Roleplay commands need usable permissions and visible, spoiler-safe activity. Previously users could not restrict rolls to a narrator, correct command-generated context, or reliably request an illustration using the chat's Illustrator settings and named character portraits. A regenerated reply must also start before the source reply's commands, just as tracker context does.

What changed

  • Update the requested settings copy and master-toggle accent state; add All/Narrator selectors for rolls and combat. Combat and illustration commands require their respective agent attached to the chat. Narrator-only permissions are enforced in prompt construction and execution.
  • Store command activity with each message swipe. Show collapsed user-only notices with the original request and results behind disclosure. Reuse the freeform editor for notes, reminders and documents; edits and deletion tombstones affect subsequent context without restoring older private text. Saves target the captured swipe even if selection changes while the request is pending.
  • Exclude source and later command context when regenerating; continuation uses the selected swipe. Notices and original command syntax never become chat-history text. Older private/document extras remain readable and editable.
  • Keep command prompts concise with single-line list spacing. Illustration requests supply the explicit subject, named avatar bytes, chat prompt mode and configured image overrides through existing host integration. Native and textual rolls share RPG attribute lookup and the existing dice service; a Strength score of 12 adds +1, while missing assignments add nothing.

The implementation stays in Engine-owned settings, prompt assembly, orchestration and storage. Downloaded agent definitions/prompts are unchanged. Narrator-only permissions require an unambiguous solo/individual responder; merged generation does not grant narrator identity.

Validation

Automated results (checkboxes below remain manual tasks):

  • pnpm check passed, including localization, formatting, TypeScript, ESLint and production builds.
  • pnpm regression:prompt passed all 3 suites. Related Roleplay, dice, Illustrator and prior-reasoning suites passed.
  • Roleplay browser suite: 15/15 passed across desktop Chromium, mobile Chromium and mobile WebKit. Settings, swipe context and agent cases repeated after the accessibility review fixes: 6/6 passed, including a missing-narrator accessible-name/description check.
  • Existing mobile Peek Prompt action-visibility regressions: 12/12 passed, covering dark/light Roleplay and Conversation layouts.
  • Docker image built successfully; its isolated container returned HTTP 200 with status: ok from /api/health.
  • The broad local Node run exposed two assertions introduced by this PR; both were corrected and their suites now pass. Two unrelated macOS failures (mari-guard-sibling-paths and storage-writer-lock) reproduce at the same assertions on clean staging 8cdb28f04. Both passed in this PR's Linux CI run. The final full Node regression suite passed in Linux CI; all required checks passed and CodeRabbit completed its final review with no new findings. The complete optional browser matrix also passed on the final commit.

Prompt/storage proof includes positive and negative rows: owner/narrator/unrelated-character isolation, All/Narrator execution, unattached agents, source/future context exclusion on regeneration, selected-swipe continuation, branching, edit failure/retry, deletion without resurrection, delayed saves after swipe switching, cross-chat rejection, invalid swipe indices, and legacy extras. Real local provider fixtures exercise native/tagged rolls and the full host Combat/Illustrator request path, including actual avatar multipart bytes and image overrides.

  • Manually verify controls, disclosures and the freeform editor on a physical iPhone, including the keyboard and safe area.
  • Manually verify narrator-only rolls/combat and illustration output with the intended downloaded agents and configured providers.

Physical iPhone and an independent manual browser session were unavailable. Browser emulation and local provider fixtures do not establish real-device behavior or real-model judgment.

Docs and release impact

Added a user-focused Unreleased changelog entry and updated canonical English UI strings. No release metadata or user documentation files changed.

UI evidence (if applicable)

Before/after screenshots and validation details. Original automated-browser PNGs are embedded in the downloadable HTML; the before image is from the prior Commands implementation proof. Evidence includes desktop/mobile, dark/light settings, narrator controls, edited context and collapsed activity.


🔄 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/5991 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 9/9/2026 **Status:** ✅ Merged **Merged:** 9/9/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `feat/roleplay-command-refinements` --- ### 📝 Commits (4) - [`fc89099`](https://github.com/Pasta-Devs/Marinara-Engine/commit/fc8909986655d7c545fd772d8292368f9b4ceb06) test(roleplay): require concise command instructions - [`ec87904`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ec87904d3d1f8bbe07f8b23147c84cd0b7e388c3) feat(roleplay): refine command controls and swipe-scoped activity - [`b284ea7`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b284ea796c177d639d7340471840e605ecb807ca) fix(roleplay): calibrate editor inset and align regression proof - [`2adb161`](https://github.com/Pasta-Devs/Marinara-Engine/commit/2adb161bd162c66b8c334669c66de3135c776cc9) fix(roleplay): separate selector names from descriptions ### 📊 Changes **21 files changed** (+1310 additions, -214 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+2 -0) 📝 `e2e/roleplay-commands.e2e.ts` (+378 -22) 📝 `packages/client/src/components/chat/ChatMessage.tsx` (+8 -1) 📝 `packages/client/src/components/chat/ChatRoleplaySurface.tsx` (+2 -0) 📝 `packages/client/src/components/chat/RoleplayCommandResults.tsx` (+220 -31) 📝 `packages/client/src/components/chat/RoleplayCommandsSettings.tsx` (+101 -45) 📝 `packages/client/src/hooks/use-chats.ts` (+15 -4) 📝 `packages/client/src/hooks/use-generate.ts` (+2 -9) 📝 `packages/client/src/localization/locales/en.json` (+26 -3) 📝 `packages/server/src/routes/chats.routes.ts` (+11 -2) 📝 `packages/server/src/routes/generate.routes.ts` (+191 -63) 📝 `packages/server/src/routes/generate/conversation-prompt-formatting.ts` (+2 -2) 📝 `packages/server/src/routes/generate/dry-run-route.ts` (+8 -0) 📝 `packages/server/src/services/generation/illustrator-manual-prompt-generation.ts` (+4 -0) 📝 `packages/server/src/services/generation/roleplay-commands.ts` (+42 -27) ➕ `packages/server/src/services/generation/roleplay-rolls.ts` (+48 -0) 📝 `packages/server/src/services/tools/tool-executor.ts` (+3 -1) 📝 `packages/shared/src/types/chat.ts` (+11 -1) 📝 `packages/shared/src/types/roleplay-command.ts` (+98 -0) 📝 `scripts/regressions/maintenance-lifecycle.regression.ts` (+3 -2) _...and 1 more files_ </details> ### 📄 Description ## Linked issue Closes #5990. Owner: @SpicyMarinara. ## Why this change Roleplay commands need usable permissions and visible, spoiler-safe activity. Previously users could not restrict rolls to a narrator, correct command-generated context, or reliably request an illustration using the chat's Illustrator settings and named character portraits. A regenerated reply must also start before the source reply's commands, just as tracker context does. ## What changed - Update the requested settings copy and master-toggle accent state; add All/Narrator selectors for rolls and combat. Combat and illustration commands require their respective agent attached to the chat. Narrator-only permissions are enforced in prompt construction and execution. - Store command activity with each message swipe. Show collapsed user-only notices with the original request and results behind disclosure. Reuse the freeform editor for notes, reminders and documents; edits and deletion tombstones affect subsequent context without restoring older private text. Saves target the captured swipe even if selection changes while the request is pending. - Exclude source and later command context when regenerating; continuation uses the selected swipe. Notices and original command syntax never become chat-history text. Older private/document extras remain readable and editable. - Keep command prompts concise with single-line list spacing. Illustration requests supply the explicit subject, named avatar bytes, chat prompt mode and configured image overrides through existing host integration. Native and textual rolls share RPG attribute lookup and the existing dice service; a Strength score of 12 adds +1, while missing assignments add nothing. The implementation stays in Engine-owned settings, prompt assembly, orchestration and storage. Downloaded agent definitions/prompts are unchanged. Narrator-only permissions require an unambiguous solo/individual responder; merged generation does not grant narrator identity. ## Validation Automated results (checkboxes below remain manual tasks): - `pnpm check` passed, including localization, formatting, TypeScript, ESLint and production builds. - `pnpm regression:prompt` passed all 3 suites. Related Roleplay, dice, Illustrator and prior-reasoning suites passed. - Roleplay browser suite: **15/15 passed** across desktop Chromium, mobile Chromium and mobile WebKit. Settings, swipe context and agent cases repeated after the accessibility review fixes: **6/6 passed**, including a missing-narrator accessible-name/description check. - Existing mobile Peek Prompt action-visibility regressions: **12/12 passed**, covering dark/light Roleplay and Conversation layouts. - Docker image built successfully; its isolated container returned HTTP 200 with `status: ok` from `/api/health`. - The broad local Node run exposed two assertions introduced by this PR; both were corrected and their suites now pass. Two unrelated macOS failures (`mari-guard-sibling-paths` and `storage-writer-lock`) reproduce at the same assertions on clean staging `8cdb28f04`. Both passed in this PR's Linux CI run. The final full Node regression suite passed in Linux CI; all required checks passed and CodeRabbit completed its final review with no new findings. The complete optional browser matrix also passed on the final commit. Prompt/storage proof includes positive and negative rows: owner/narrator/unrelated-character isolation, All/Narrator execution, unattached agents, source/future context exclusion on regeneration, selected-swipe continuation, branching, edit failure/retry, deletion without resurrection, delayed saves after swipe switching, cross-chat rejection, invalid swipe indices, and legacy extras. Real local provider fixtures exercise native/tagged rolls and the full host Combat/Illustrator request path, including actual avatar multipart bytes and image overrides. - [ ] Manually verify controls, disclosures and the freeform editor on a physical iPhone, including the keyboard and safe area. - [ ] Manually verify narrator-only rolls/combat and illustration output with the intended downloaded agents and configured providers. Physical iPhone and an independent manual browser session were unavailable. Browser emulation and local provider fixtures do not establish real-device behavior or real-model judgment. ## Docs and release impact Added a user-focused Unreleased changelog entry and updated canonical English UI strings. No release metadata or user documentation files changed. ## UI evidence (if applicable) [Before/after screenshots and validation details](https://gist.github.com/SpicyMarinara/1c2b1bbc60ca2c65d6f42bef487c8f92). Original automated-browser PNGs are embedded in the downloadable HTML; the before image is from the prior Commands implementation proof. Evidence includes desktop/mobile, dark/light settings, narrator controls, edited context and collapsed activity. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:15:47 +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#7018
No description provided.