mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #8007] [MERGED] fix(scene): start from the starred Roleplay profile, repair loose planner JSON, write the opening in the right voice #8052
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#8052
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/8007
Author: @JamesMowery
Created: 10/21/2026
Status: ✅ Merged
Merged: 10/23/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/scene-chat-fixes📝 Commits (10+)
530f456fix(scene): a new Scene starts from the starred Roleplay settings profileda84426fix(scene): the opening follows the starred profile's writing rules0396f6efix(scene): repair slightly broken JSON from the scene plannerc2658ebfix(json): repair dialogue quotes inside one-line JSON string values01bcbd0fix(json): escape dialogue quotes before jsonrepair, only on invalid lines30b03adstyle: format the JSON repair and scene regressionb80bbfffix(scene): the opening message is written in its poster's voice4c6adadfix(scene): quote spoken words in the opening, and post the description as narration378cbc5fix(scene): write the opening for the scene's group modef7ae393test(scene): check the starred profile after the opening-speaker cases📊 Changes
6 files changed (+616 additions, -32 deletions)
View changed files
📝
docs/roleplay/scenes.md(+7 -1)📝
packages/client/src/lib/scene-generation.ts(+2 -0)📝
packages/server/src/lib/json-repair.ts(+128 -1)📝
packages/server/src/routes/scene.routes.ts(+126 -30)📝
packages/shared/src/types/scene.ts(+2 -0)📝
scripts/regressions/scene-participants.regression.ts(+351 -0)📄 Description
Linked issue
Closes #8006
@SpicyMarinara
Why this change
What changed
The starred Roleplay profile
/scene/createapplies the starred Roleplay settings profile before writing the scene's own settings, as a new Roleplay chat does. The connection is the one the request named, else the profile's, else the Conversation's; a prompt preset picked for the scene stays; scene settings, background and lorebooks go on top. The built-in Default profile is left out, as it is for new chats.Broken JSON from the planner
tryParseJsonRecord(jsonrepair), as agents, memory and summaries do, instead of two regex repairs. It still fails clearly when nothing can be read.repairJsonTextkeepsjsonrepair's reading first, as before, unless it holds a key that was never a quoted key in the model's text (keys are collected once and decoded as JSON reads them): that is howjsonrepairmangles dialogue quotes inside a value ("So. You came back.", The librarian smiles. "Again?"becomes aThe librarian smiles.key). Only then does it escape the quotes inside each"key": "value"of a line that isn't valid on its own, splitting a line with several properties at each, "key":first. Every caller oftryParseJsonRecord/repairJsonTextgets this, and only for text that failed to parse. Dialogue that itself holds, "key": "value"can't be told from a property, so therejsonrepair's reading stands.The opening message
initiatorCharId. The planner is told the opening character by name and to write only as them, and a cast the model picks always keeps that character, so/scene/createcredits the same one.extra.sceneParticipationGuide,extra.sceneDescriptionMessage), so a scene fork that leaves the guide out drops exactly it, even in a scene that had none; scenes made before keep the old rule.Docs:
docs/roleplay/scenes.md(leaving Prompt preset on None uses the starred profile's preset; what the new scene starts from and how its opening is written).Validation
pnpm checkpasses locallyCONTRIBUTING.mdAutomated runs on 2026-10-21 on
staging5e7468ab4, Node 24.21.0:pnpm check: passes. Its one lint warning, inHomeProfessorMariChat.tsx, is not from this PR.pnpm localization:check: passes.scene-participants, through the real routes with a fake model: the starred profile applied to a new scene with its own settings and connection; its writing rules in the planner prompt; plans from JSON with an unquoted key, single quotes and a trailing comma, and with unescaped dialogue quotes (kept as text); two properties on one valid line kept apart; the opening character named in the planner prompt and kept in a model-picked cast; the quote rule; the opening as only the character's text with the guide and description as separate narrator messages; a fork without the guide; Individual and merged group modes. Five of the fix commits record that their check fails without the fix.pnpm regressiononf7ae3938f: 960/960 pass. The two later commits (docs, and the description marker below) were checked withscene-participantsand a server type check.bb05b61be: a scene whose plan had no participation guide lost its description in a fork without the guide, because nothing was marked and the old "first narrator message" rule took the description. The description is now marked too (extra.sceneDescriptionMessage);scene-participantscovers it and fails without the fix. A review of the docs and that fix: 0 findings.pnpm smoke:uiandpnpm regression:ui(no client UI changes beyond the plan request's new field).Manual verification notes
Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)English docs updated:
docs/roleplay/scenes.md. Translations: #8008UI evidence (if applicable)
No UI changes.
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
[PR #8007] fix(scene): start from the starred Roleplay profile, repair loose planner JSON, write the opening in the right voiceto [PR #8007] [MERGED] fix(scene): start from the starred Roleplay profile, repair loose planner JSON, write the opening in the right voice