mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #375] [MERGED] fix(game): instruct GM to use plain quotes in [choices:] options #4590
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#4590
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/375
Author: @cha1latte
Created: 5/3/2026
Status: ✅ Merged
Merged: 5/3/2026
Merged by: @cha1latte
Base:
main← Head:fix/gm-choice-quote-format📝 Commits (1)
9e861d0fix(game): instruct GM to use plain quotes in [choices:] options📊 Changes
2 files changed (+1 additions, -21 deletions)
View changed files
📝
packages/client/src/components/game/GameChoiceCards.tsx(+0 -20)📝
packages/server/src/services/game/gm-prompts.ts(+1 -1)📄 Description
Summary
Tighten the
[choices:]format guidance in the GM prompt so models don't emitJSON-style escaped quotes inside choice values. Also remove a dead duplicate
of the choice parser that was sitting unused in
GameChoiceCards.tsx.Why
Some models (reported on GLM) emit
[choices: "\"Suzuki, wait—\"" | ... ]with backslash-escaped inner quotes. The live parser in
packages/client/src/lib/game-tag-parser.tsstrips one outer quote per optionbut doesn't unescape
\", so the literal backslashes survive into the choicestrings and get rendered on the CHOOSE YOUR ACTION card via
AnimatedText/dangerouslySetInnerHTML. End-state: users see\"Suzuki, wait—\"on screen. Discord mirror happens to look clean becauseDiscord's markdown swallows
\", but the underlying bytes are the same.The simplest, root-cause fix is the prompt: explicitly tell the GM to use
plain straight quotes around each option and not to escape inner quotes with
backslashes. This solves it for any model that follows instructions, without
adding a defensive-parsing maintenance surface.
The dead
parseChoiceTagfunction inGameChoiceCards.tsxhad zero importsacross the codebase — the real parser is
parseGmTagsinlib/game-tag-parser.ts. Removing it now to prevent drift.Changes
packages/server/src/services/game/gm-prompts.ts— append plain-quote /no-escape guidance to the
[choices:]line in the format reminder(~10 words added).
packages/client/src/components/game/GameChoiceCards.tsx— delete unusedparseChoiceTagexport (and its// ── Tag Parser ──divider).Known limitations
still emit and render cleanly. Not yet verified end-to-end on GLM (the
model that exhibited the original bug). Original reporter to confirm
on their setup post-merge — happy to follow up with parser-side hardening
if GLM still escapes despite the prompt change.
could add a small unescape pass in the parser as defense-in-depth, but
that's deferred until we see a second model report this.
Test plan
Reviewer / merger: please verify rather than checking these blindly.
model in GM mode (Claude / GPT-4 class / Gemini).
isn't confused by the tighter wording).
pnpm checkpasses.Screenshots
Docs touched
None. No user-facing config or behavior change documented anywhere.
Summary by CodeRabbit
Chores
Documentation
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.