[GH-ISSUE #6157] There is no way to turn off the extra model request that a Game turn spends after a written dice roll #3430

Closed
opened 2026-10-21 06:03:00 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @kolacheee on GitHub (Sep 13, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6157

Originally assigned to: @SpicyMarinara on GitHub.

When the Game Master writes a dice or skill check request as text, the app rolls the dice and then sends the whole prompt a second time so the Game Master can finish the outcome in the same turn. That is good narration and it is the intended design, but a player who cares about cost has no way to go back to the cheaper one request flow, and nothing in the app says the turn costs double. Since the September fix sweep it also spends that second full prompt on turns where nothing could be rolled at all.

How to reproduce (try it yourself)

  1. Open a Game chat on a per token connection, such as any OpenAI compatible one. A subscription connection behaves the same way.
  2. Take a turn with no dice in it. Open that message's generation info, the token readout on the message, and write down the prompt and completion token counts. Call them N and M.
  3. Take a turn that calls for one ordinary skill check, so the Game Master writes a plain [skill_check: skill="Stealth" dc="15"] request instead of calling the dice tool.
  4. Open that message's generation info.
  5. Now turn Enable Tool Use on and repeat step 3. Whenever the Game Master writes the text tag instead of calling roll_dice, which its own prompt asks it to do unless a roll_dice result is already in hand, the same thing happens.
  6. Ask the Game Master for a roll in notation the app cannot read, such as 4dF or 3d6!.
  7. Look through the Game setup options and Chat Settings for a way back to the one request flow, or for any warning that a check turn costs more.

What you'll see: In step 4 the prompt count is about 2N and the completion count about 2M, because the turn sent two full prompts and the readout summed them. Peek Prompt shows only one prompt, since the follow up overwrites the cached one, but its last message starts with "The engine has now rolled the requested dice:", which is the in app tell that a second full prompt went out. In step 6 nothing is rolled, yet the turn still spends a second full prompt whose summary line reads "No dice were rolled." In step 7 there is no setting and no notice anywhere in the app. The cost is written down only in docs/game/dice-and-skill-checks.md under "Skill checks".

What should happen: The same turn flow by default, plus a switch for players who would rather pay one request and get the outcome on the next turn, and a turn that rolls nothing should not cost a full extra prompt.

Where it is

packages/server/src/routes/generate.routes.ts at staging ac14dd704. Line 7948 is the only gate on the whole block: if (chatMode === "game" && !input.impersonate) {. There is no chat setting, no connection capability check and no tools check. Line 7970 decides whether the follow up runs: if (rolled.resolved || generalRolls.rolled || generalRolls.unresolved.length || rolled.sparse) {. Line 7979 rebuilds the full prompt with fitPromptForSend over the whole narrator history plus the draft, so the follow up is a full resend and not a small delta. Line 7995 issues the second billed request. The nearest existing per chat Game switch is enableQuickTimeEvents in packages/shared/src/types/game.ts:236, surfaced in the Game Setup Wizard under "Game Features" (packages/client/src/components/game/GameSetupWizard.tsx:2229).

What's happening

The trigger is simply that the turn contained a roll request written as text. That covers tool capable connections too, because the Game Master prompt asks for the short text form whenever a roll_dice result is not already in hand. The path where roll_dice actually ran and the Game Master wrote a complete record is correctly exempt and costs one request. Nothing narrows the rest: not the connection type, not whether tools are on, not any setting. The follow up resends the entire prompt, so a check turn costs up to twice the input tokens, less on a caching connection since the resent prefix can be a cache read, and twice the completion tokens everywhere. PR #6137 widened line 7970 so that a request in unreadable notation, which rolls nothing, now also pays a full second prompt.

Suggested fix

Add one per chat Game setting, default on, that keeps the current same turn outcome and, when switched off, returns the old flow where the outcome lands on the next turn. It belongs beside enableQuickTimeEvents in the Game Features group so players find it where the other Game switches live. Two smaller pieces go with it. First, consider skipping the follow up when the connection could have used roll_dice in loop, since there the second request buys back something the tool path already gives for free. Second, do not spend a full prompt on the zero roll arm at line 7970 (generalRolls.unresolved.length || rolled.sparse); a clarification that costs as much as a narration turn is a poor trade for telling the Game Master that 4dF could not be read. Finally, surface the cost where the player is: a line in the Game settings copy, since today it exists only in the docs.

Context

The follow up shipped in the batch credited to #5956, #5959, #5960 and #5961 (CHANGELOG.md:221). That changelog line frames it as something "Text-only connections" get, which under describes it: a tool capable per token connection pays it too whenever the Game Master writes the text tag. Worth correcting that wording. The docs line at docs/game/dice-and-skill-checks.md:74 is accurate and already states that the extra request uses more input and output tokens. PR #6137 did touch this exact area: it widened the gate at line 7970 to include unresolvable and sparse requests and added failure handling, but added no opt out, and scripts/regressions/game-text-dice.regression.ts:215 now pins the two call shape even for an unsupported only request. This is unreleased on staging; the latest release tag is v2.4.4.

Found by an AI-assisted sweep and re-verified against staging ac14dd704 on 2026-09-13. Please verify before fixing.

Originally created by @kolacheee on GitHub (Sep 13, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6157 Originally assigned to: @SpicyMarinara on GitHub. When the Game Master writes a dice or skill check request as text, the app rolls the dice and then sends the whole prompt a second time so the Game Master can finish the outcome in the same turn. That is good narration and it is the intended design, but a player who cares about cost has no way to go back to the cheaper one request flow, and nothing in the app says the turn costs double. Since the September fix sweep it also spends that second full prompt on turns where nothing could be rolled at all. ## How to reproduce (try it yourself) 1. Open a Game chat on a per token connection, such as any OpenAI compatible one. A subscription connection behaves the same way. 2. Take a turn with no dice in it. Open that message's generation info, the token readout on the message, and write down the prompt and completion token counts. Call them N and M. 3. Take a turn that calls for one ordinary skill check, so the Game Master writes a plain `[skill_check: skill="Stealth" dc="15"]` request instead of calling the dice tool. 4. Open that message's generation info. 5. Now turn Enable Tool Use on and repeat step 3. Whenever the Game Master writes the text tag instead of calling `roll_dice`, which its own prompt asks it to do unless a `roll_dice` result is already in hand, the same thing happens. 6. Ask the Game Master for a roll in notation the app cannot read, such as `4dF` or `3d6!`. 7. Look through the Game setup options and Chat Settings for a way back to the one request flow, or for any warning that a check turn costs more. **What you'll see:** In step 4 the prompt count is about 2N and the completion count about 2M, because the turn sent two full prompts and the readout summed them. Peek Prompt shows only one prompt, since the follow up overwrites the cached one, but its last message starts with "The engine has now rolled the requested dice:", which is the in app tell that a second full prompt went out. In step 6 nothing is rolled, yet the turn still spends a second full prompt whose summary line reads "No dice were rolled." In step 7 there is no setting and no notice anywhere in the app. The cost is written down only in `docs/game/dice-and-skill-checks.md` under "Skill checks". **What should happen:** The same turn flow by default, plus a switch for players who would rather pay one request and get the outcome on the next turn, and a turn that rolls nothing should not cost a full extra prompt. ## Where it is `packages/server/src/routes/generate.routes.ts` at staging ac14dd704. Line 7948 is the only gate on the whole block: `if (chatMode === "game" && !input.impersonate) {`. There is no chat setting, no connection capability check and no tools check. Line 7970 decides whether the follow up runs: `if (rolled.resolved || generalRolls.rolled || generalRolls.unresolved.length || rolled.sparse) {`. Line 7979 rebuilds the full prompt with `fitPromptForSend` over the whole narrator history plus the draft, so the follow up is a full resend and not a small delta. Line 7995 issues the second billed request. The nearest existing per chat Game switch is `enableQuickTimeEvents` in `packages/shared/src/types/game.ts:236`, surfaced in the Game Setup Wizard under "Game Features" (`packages/client/src/components/game/GameSetupWizard.tsx:2229`). ## What's happening The trigger is simply that the turn contained a roll request written as text. That covers tool capable connections too, because the Game Master prompt asks for the short text form whenever a `roll_dice` result is not already in hand. The path where `roll_dice` actually ran and the Game Master wrote a complete record is correctly exempt and costs one request. Nothing narrows the rest: not the connection type, not whether tools are on, not any setting. The follow up resends the entire prompt, so a check turn costs up to twice the input tokens, less on a caching connection since the resent prefix can be a cache read, and twice the completion tokens everywhere. PR #6137 widened line 7970 so that a request in unreadable notation, which rolls nothing, now also pays a full second prompt. ## Suggested fix Add one per chat Game setting, default on, that keeps the current same turn outcome and, when switched off, returns the old flow where the outcome lands on the next turn. It belongs beside `enableQuickTimeEvents` in the Game Features group so players find it where the other Game switches live. Two smaller pieces go with it. First, consider skipping the follow up when the connection could have used `roll_dice` in loop, since there the second request buys back something the tool path already gives for free. Second, do not spend a full prompt on the zero roll arm at line 7970 (`generalRolls.unresolved.length || rolled.sparse`); a clarification that costs as much as a narration turn is a poor trade for telling the Game Master that `4dF` could not be read. Finally, surface the cost where the player is: a line in the Game settings copy, since today it exists only in the docs. ## Context The follow up shipped in the batch credited to #5956, #5959, #5960 and #5961 (CHANGELOG.md:221). That changelog line frames it as something "Text-only connections" get, which under describes it: a tool capable per token connection pays it too whenever the Game Master writes the text tag. Worth correcting that wording. The docs line at `docs/game/dice-and-skill-checks.md:74` is accurate and already states that the extra request uses more input and output tokens. PR #6137 did touch this exact area: it widened the gate at line 7970 to include unresolvable and sparse requests and added failure handling, but added no opt out, and `scripts/regressions/game-text-dice.regression.ts:215` now pins the two call shape even for an unsupported only request. This is unreleased on staging; the latest release tag is v2.4.4. Found by an AI-assisted sweep and re-verified against staging ac14dd704 on 2026-09-13. Please verify before fixing.
bsakaguchi 2026-10-21 06:03:00 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (Sep 13, 2026):

Codex is addressing this report on behalf of @SpicyMarinara in draft PR #6168 as part of the requested issue sweep. I will verify the reported path against staging and preserve existing behavior outside the narrow fix.

<!-- gh-comment-id:5654635651 --> @SpicyMarinara commented on GitHub (Sep 13, 2026): Codex is addressing this report on behalf of @SpicyMarinara in draft PR #6168 as part of the requested issue sweep. I will verify the reported path against staging and preserve existing behavior outside the narrow fix.
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#3430
No description provided.