[PR #8194] [MERGED] fix(game): reveal a saved reply at once, one roll for narration and sheet, arm choice cards, separate tool rounds #8179

Closed
opened 2026-10-25 04:04:29 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8194
Author: @kolacheee
Created: 10/23/2026
Status: ✅ Merged
Merged: 10/23/2026
Merged by: @kolacheee

Base: staging ← Head: claude/project-thread-nibhp6


📝 Commits (10+)

  • 9e5e5c1 fix(game): start a new paragraph after a tool call and cut the Game Master's announcement of it
  • 58f83af fix(game): stop typing out a Game reply's unseen stream before revealing the saved narration
  • acb9023 fix(game): a sheet amount that repeats a narrated roll takes that same roll
  • e21452f fix(game): choice cards take a click only after a short arming delay
  • a6a1758 fix(game): keep a rewritten round's paragraph break and bound the tool-announcement cut
  • b9f2a07 Merge remote-tracking branch 'origin/staging' into claude/project-thread-nibhp6
  • 36f1170 fix(game): cut a tool announcement only when it names the roll or the number it is after
  • 95fd82e fix(game): cut only an announcement whose object is the roll or the result it waits on
  • 7b02093 Merge remote-tracking branch 'origin/staging' into claude/project-thread-nibhp6
  • a43f79c fix(game): cut roll announcements that name initiative, a save, a check or damage, and bare ones

📊 Changes

12 files changed (+379 additions, -15 deletions)

View changed files

📝 packages/client/src/components/game/GameChoiceCards.tsx (+13 -2)
📝 packages/client/src/hooks/use-generate.ts (+6 -0)
📝 packages/client/src/lib/generation-stream-policy.ts (+9 -0)
📝 packages/server/src/routes/generate/tool-rounds.ts (+42 -12)
📝 packages/server/src/services/game/gm-planning.ts (+38 -0)
📝 packages/server/src/services/game/gm-prompts.ts (+2 -1)
📝 packages/shared/src/utils/dice-placeholder.ts (+19 -0)
➕ scripts/regressions/game-choice-cards-arm.regression.ts (+27 -0)
📝 scripts/regressions/game-gm-turn-roller-party.regression.ts (+28 -0)
📝 scripts/regressions/game-mode-dice-tool.regression.ts (+5 -0)
📝 scripts/regressions/generate-tool-rounds.regression.ts (+180 -0)
📝 scripts/regressions/roleplay-streaming.regression.ts (+10 -0)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #8193
Closes #8195
Closes #8198
Closes #8199

Why this change

A playtest of Game Master turns found four problems.

  • Late reveal: a Game reply was saved about 30 s after Send, but its narration appeared minutes later, with the server idle the whole time. The client was typing the reply's live stream out at the reading speed and waiting for that before revealing the saved message. Game Mode never shows the live stream.
  • Two rolls for one number: in a one-request turn, the narration's [[roll: 1d6]] and the sheet command's amount="[[roll: 1d6]]" for the same fall rolled separately. The narration said 2, and the sheet took 5.
  • Accidental choice: the choice cards open where the segment's Next button just was, so a quick Next click sent the first choice as a whole turn.
  • Glued text: a Game Master called roll_dice mid-reply, and the saved narration read "...kneels in the lamplight — let me get the number.Warmth goes out...".

What changed

  • No typewriter for Game streams (client): a Game generation moves its stream text straight through (shouldTypeOutLiveStream), so nothing waits on a typewriter drain or on animation frames before the saved narration is revealed. Other modes type as before.
  • One roll for the narration and the sheet (shared): a placeholder written as a sheet command's amount, [sheet: ... amount="[[roll: 1d6]]"], takes the result of the nearest earlier narrated placeholder with the same notation.
    • Each narrated roll pairs with one amount, and no second die or card is made.
    • A different notation, or prose that merely repeats a notation, still rolls its own.
    • The one-request sheet line tells the Game Master to repeat the placeholder for this.
  • Choice cards arm before taking a click (client): a click in the first 700 ms after the cards appear is ignored.
  • A new paragraph after a native tool call (server, every mode): the next round's text starts a new paragraph, unless the text before the call already ends in whitespace or the next round starts with it. A roleplay [roll:] written in the text continues inline as before.
  • The Game Master's announcement of a call is cut (server): in Game Mode, a final sentence or dash-led clause that says the writer is about to roll, check or get a number is cut from the text before the call, such as "— let me get the number.". The client's view is corrected with content_replace.
    • The player's own impersonated line is never touched.
    • Look-alikes are left alone, such as quoted dialogue or a sentence that goes on afterwards.
    • The prompt now says to call roll_dice without announcing it.

Validation

  • Server, shared and client typecheck, prettier, eslint on the changed client files
  • roleplay-streaming: a Game generation is not typed out, and startTypewriter flushes straight through for Game.
  • game-gm-turn-roller-party:
    • A narrated roll and its sheet amount get one die, one record and the same number.
    • Two narrated rolls pair with the nearest amounts.
    • A different notation, or repeated prose, rolls its own.
    • The prompt line is pinned.
  • game-choice-cards-arm (new): the arming delay, its cleanup, and the click guard.
  • generate-tool-rounds:
    • Game Mode cuts the announcement and separates the rounds.
    • Conversation mode only separates.
    • An impersonated line is untouched.
    • The cutter is checked against real cases and look-alikes.
  • game-mode-dice-tool, one-request-dice-prompt (the shipped DICE block still byte for byte), one-request-dice-placeholders, game-gm-*
  • pnpm check passes locally
  • Container (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.md

Manual verification notes

  • The laptop playtest will re-test the reveal time, the fall's damage number, the choice cards, and the Cure Wounds turn against a real Game Master.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

None: no layout changes. The narration shows sooner, and the choice cards ignore a click in their first 700 ms.


🔄 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/8194 **Author:** [@kolacheee](https://github.com/kolacheee) **Created:** 10/23/2026 **Status:** ✅ Merged **Merged:** 10/23/2026 **Merged by:** [@kolacheee](https://github.com/kolacheee) **Base:** `staging` ← **Head:** `claude/project-thread-nibhp6` --- ### 📝 Commits (10+) - [`9e5e5c1`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9e5e5c1c73b4daf912e229744262cd7b25abc441) fix(game): start a new paragraph after a tool call and cut the Game Master's announcement of it - [`58f83af`](https://github.com/Pasta-Devs/Marinara-Engine/commit/58f83af73585c3ebdd4e1b08b0220740cb539fc7) fix(game): stop typing out a Game reply's unseen stream before revealing the saved narration - [`acb9023`](https://github.com/Pasta-Devs/Marinara-Engine/commit/acb90238ae7384a0aa89cb0c13c34f2aadd0ab02) fix(game): a sheet amount that repeats a narrated roll takes that same roll - [`e21452f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/e21452f07bf68534ef0bc0c9fffa5329f8023627) fix(game): choice cards take a click only after a short arming delay - [`a6a1758`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a6a17582339e31393047789bd05756fcaef889f3) fix(game): keep a rewritten round's paragraph break and bound the tool-announcement cut - [`b9f2a07`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b9f2a0788f79bf2d19454922f2c6918bf0efbfed) Merge remote-tracking branch 'origin/staging' into claude/project-thread-nibhp6 - [`36f1170`](https://github.com/Pasta-Devs/Marinara-Engine/commit/36f11701b2bdd649f5c3f50eb2c6497763fb4b94) fix(game): cut a tool announcement only when it names the roll or the number it is after - [`95fd82e`](https://github.com/Pasta-Devs/Marinara-Engine/commit/95fd82e752f434d47dbfeb1dee1c99cf5a543593) fix(game): cut only an announcement whose object is the roll or the result it waits on - [`7b02093`](https://github.com/Pasta-Devs/Marinara-Engine/commit/7b02093f0a58bc4c013b4389102003a84050f1a6) Merge remote-tracking branch 'origin/staging' into claude/project-thread-nibhp6 - [`a43f79c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/a43f79c9b8c6029b5e773cc471c8014c21148332) fix(game): cut roll announcements that name initiative, a save, a check or damage, and bare ones ### 📊 Changes **12 files changed** (+379 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/game/GameChoiceCards.tsx` (+13 -2) 📝 `packages/client/src/hooks/use-generate.ts` (+6 -0) 📝 `packages/client/src/lib/generation-stream-policy.ts` (+9 -0) 📝 `packages/server/src/routes/generate/tool-rounds.ts` (+42 -12) 📝 `packages/server/src/services/game/gm-planning.ts` (+38 -0) 📝 `packages/server/src/services/game/gm-prompts.ts` (+2 -1) 📝 `packages/shared/src/utils/dice-placeholder.ts` (+19 -0) ➕ `scripts/regressions/game-choice-cards-arm.regression.ts` (+27 -0) 📝 `scripts/regressions/game-gm-turn-roller-party.regression.ts` (+28 -0) 📝 `scripts/regressions/game-mode-dice-tool.regression.ts` (+5 -0) 📝 `scripts/regressions/generate-tool-rounds.regression.ts` (+180 -0) 📝 `scripts/regressions/roleplay-streaming.regression.ts` (+10 -0) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Closes #8193 Closes #8195 Closes #8198 Closes #8199 ## Why this change A playtest of Game Master turns found four problems. - **Late reveal:** a Game reply was saved about 30 s after Send, but its narration appeared minutes later, with the server idle the whole time. The client was typing the reply's live stream out at the reading speed and waiting for that before revealing the saved message. Game Mode never shows the live stream. - **Two rolls for one number:** in a one-request turn, the narration's `[[roll: 1d6]]` and the sheet command's `amount="[[roll: 1d6]]"` for the same fall rolled separately. The narration said 2, and the sheet took 5. - **Accidental choice:** the choice cards open where the segment's Next button just was, so a quick Next click sent the first choice as a whole turn. - **Glued text:** a Game Master called `roll_dice` mid-reply, and the saved narration read "...kneels in the lamplight — let me get the number.Warmth goes out...". ## What changed - **No typewriter for Game streams (client):** a Game generation moves its stream text straight through (`shouldTypeOutLiveStream`), so nothing waits on a typewriter drain or on animation frames before the saved narration is revealed. Other modes type as before. - **One roll for the narration and the sheet (shared):** a placeholder written as a sheet command's amount, `[sheet: ... amount="[[roll: 1d6]]"]`, takes the result of the nearest earlier narrated placeholder with the same notation. - Each narrated roll pairs with one amount, and no second die or card is made. - A different notation, or prose that merely repeats a notation, still rolls its own. - The one-request sheet line tells the Game Master to repeat the placeholder for this. - **Choice cards arm before taking a click (client):** a click in the first 700 ms after the cards appear is ignored. - **A new paragraph after a native tool call (server, every mode):** the next round's text starts a new paragraph, unless the text before the call already ends in whitespace or the next round starts with it. A roleplay `[roll:]` written in the text continues inline as before. - **The Game Master's announcement of a call is cut (server):** in Game Mode, a final sentence or dash-led clause that says the writer is about to roll, check or get a number is cut from the text before the call, such as "— let me get the number.". The client's view is corrected with `content_replace`. - The player's own impersonated line is never touched. - Look-alikes are left alone, such as quoted dialogue or a sentence that goes on afterwards. - The prompt now says to call `roll_dice` without announcing it. ## Validation - [x] Server, shared and client typecheck, prettier, eslint on the changed client files - [x] `roleplay-streaming`: a Game generation is not typed out, and `startTypewriter` flushes straight through for Game. - [x] `game-gm-turn-roller-party`: - A narrated roll and its sheet amount get one die, one record and the same number. - Two narrated rolls pair with the nearest amounts. - A different notation, or repeated prose, rolls its own. - The prompt line is pinned. - [x] `game-choice-cards-arm` (new): the arming delay, its cleanup, and the click guard. - [x] `generate-tool-rounds`: - Game Mode cuts the announcement and separates the rounds. - Conversation mode only separates. - An impersonated line is untouched. - The cutter is checked against real cases and look-alikes. - [x] `game-mode-dice-tool`, `one-request-dice-prompt` (the shipped DICE block still byte for byte), `one-request-dice-placeholders`, `game-gm-*` - [ ] `pnpm check` passes locally - [ ] Container (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) - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes - The laptop playtest will re-test the reveal time, the fall's damage number, the choice cards, and the Cure Wounds turn against a real Game Master. ## Docs and release impact - [x] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) None: no layout changes. The narration shows sooner, and the choice cards ignore a click in their first 700 ms. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-25 04:04:29 +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#8179
No description provided.