[PR #3715] [MERGED] Fix Roleplay persona selection and remove summary caps #6068

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

📋 Pull Request Information

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

Base: staging ← Head: agent/release-blocking-roleplay-fixes


📝 Commits (1)

  • d450d4b fix: preserve persona-less roleplay and full summaries

📊 Changes

13 files changed (+102 additions, -85 deletions)

View changed files

📝 CHANGELOG.md (+2 -0)
📝 packages/client/src/components/chat/ChatArea.tsx (+9 -6)
📝 packages/client/src/hooks/use-generate.ts (+4 -5)
📝 packages/server/src/routes/chats.routes.ts (+4 -5)
📝 packages/server/src/routes/encounter.routes.ts (+4 -5)
📝 packages/server/src/routes/generate.routes.ts (+6 -7)
📝 packages/server/src/routes/generate/generate-route-utils.ts (+4 -8)
📝 packages/server/src/routes/scene.routes.ts (+3 -4)
📝 packages/server/src/services/generation/roleplay-summary-runtime.ts (+6 -0)
📝 packages/shared/src/index.ts (+1 -0)
➕ packages/shared/src/utils/chat-persona.ts (+18 -0)
📝 packages/shared/src/utils/chat-summary-entries.ts (+1 -45)
📝 scripts/regressions/prompt.regression.ts (+40 -0)

📄 Description

Why

Three maintainer-reported limits can silently change Roleplay behavior or discard legitimate long-form data before the v3.2.2 release:

  • a newly created Roleplay chat can attach the active Persona even when the user explicitly selected no Persona
  • Roleplay summary generation truncates every source message to 2,000 characters, which breaks chapter-length generations
  • compiled chat summary metadata in chats.json is silently truncated to 64 KiB

No linked issue was supplied; this is a maintainer-requested release-blocking fix batch.

What

  • preserve an explicit no-Persona Roleplay selection through optimistic message snapshots, provider prompts, scenes, and encounters
  • retain Conversation mode active-Persona fallback for its account-style behavior
  • pass complete Roleplay messages into manual and automatic summary generation
  • persist complete compiled summaries without the former 64 KiB metadata ceiling
  • retain structural validation and surface provider context failures normally
  • add focused regressions and v3.2.2 release notes

Test plan

  • Manually create a Roleplay chat with a Character and no Persona, then verify the first generation keeps personaId null.
  • Manually summarize a Roleplay chat containing a message longer than 8,000 characters.
  • Manually persist accumulated chat summaries larger than 64 KiB.
  • Run pnpm regression:prompt.
  • Run pnpm check.
  • Run pnpm version:check.

Summary by CodeRabbit

  • Bug Fixes
    • Roleplay chats now preserve an explicitly selected “no Persona” setting throughout generation, prompts, scenes, and combat.
    • Conversation mode continues to support fallback to the globally active Persona.
    • Longer roleplay summaries and chapter-length inputs are no longer truncated automatically.
  • Tests
    • Added regression coverage for Persona selection behavior and expanded summary size handling.

🔄 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/3715 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 7/16/2026 **Status:** ✅ Merged **Merged:** 7/16/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `agent/release-blocking-roleplay-fixes` --- ### 📝 Commits (1) - [`d450d4b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d450d4becacbfa9f5ac02c5fb21bb2b389e164a2) fix: preserve persona-less roleplay and full summaries ### 📊 Changes **13 files changed** (+102 additions, -85 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+2 -0) 📝 `packages/client/src/components/chat/ChatArea.tsx` (+9 -6) 📝 `packages/client/src/hooks/use-generate.ts` (+4 -5) 📝 `packages/server/src/routes/chats.routes.ts` (+4 -5) 📝 `packages/server/src/routes/encounter.routes.ts` (+4 -5) 📝 `packages/server/src/routes/generate.routes.ts` (+6 -7) 📝 `packages/server/src/routes/generate/generate-route-utils.ts` (+4 -8) 📝 `packages/server/src/routes/scene.routes.ts` (+3 -4) 📝 `packages/server/src/services/generation/roleplay-summary-runtime.ts` (+6 -0) 📝 `packages/shared/src/index.ts` (+1 -0) ➕ `packages/shared/src/utils/chat-persona.ts` (+18 -0) 📝 `packages/shared/src/utils/chat-summary-entries.ts` (+1 -45) 📝 `scripts/regressions/prompt.regression.ts` (+40 -0) </details> ### 📄 Description ## Why Three maintainer-reported limits can silently change Roleplay behavior or discard legitimate long-form data before the v3.2.2 release: - a newly created Roleplay chat can attach the active Persona even when the user explicitly selected no Persona - Roleplay summary generation truncates every source message to 2,000 characters, which breaks chapter-length generations - compiled chat summary metadata in `chats.json` is silently truncated to 64 KiB No linked issue was supplied; this is a maintainer-requested release-blocking fix batch. ## What - preserve an explicit no-Persona Roleplay selection through optimistic message snapshots, provider prompts, scenes, and encounters - retain Conversation mode active-Persona fallback for its account-style behavior - pass complete Roleplay messages into manual and automatic summary generation - persist complete compiled summaries without the former 64 KiB metadata ceiling - retain structural validation and surface provider context failures normally - add focused regressions and v3.2.2 release notes ## Test plan - [ ] Manually create a Roleplay chat with a Character and no Persona, then verify the first generation keeps `personaId` null. - [ ] Manually summarize a Roleplay chat containing a message longer than 8,000 characters. - [ ] Manually persist accumulated chat summaries larger than 64 KiB. - [ ] Run `pnpm regression:prompt`. - [ ] Run `pnpm check`. - [ ] Run `pnpm version:check`. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Roleplay chats now preserve an explicitly selected “no Persona” setting throughout generation, prompts, scenes, and combat. * Conversation mode continues to support fallback to the globally active Persona. * Longer roleplay summaries and chapter-length inputs are no longer truncated automatically. * **Tests** * Added regression coverage for Persona selection behavior and expanded summary size handling. <!-- 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:06:48 +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#6068
No description provided.