mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[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
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#3430
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?
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)
[skill_check: skill="Stealth" dc="15"]request instead of calling the dice tool.roll_dice, which its own prompt asks it to do unless aroll_diceresult is already in hand, the same thing happens.4dFor3d6!.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.mdunder "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.tsat stagingac14dd704. 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 withfitPromptForSendover 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 isenableQuickTimeEventsinpackages/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_diceresult is not already in hand. The path whereroll_diceactually 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
enableQuickTimeEventsin 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 usedroll_dicein 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 that4dFcould 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:74is 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, andscripts/regressions/game-text-dice.regression.ts:215now 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
ac14dd704on 2026-09-13. Please verify before fixing.@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.