mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #6127] When the follow-up request that rewrites a turn with the real dice fails, the turn becomes a bare list of numbers and shows every result twice #3403
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#3403
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/6127
Originally assigned to: @SpicyMarinara on GitHub.
When the Game Master's turn needs dice, the engine rolls them and then makes one more request asking the model to rewrite the turn using the real results. If that second request fails - a dropped connection, a rate limit, a local model that died - the saved turn becomes a bare list of numbers ("Might check (DC 30): [12] = 12. Failure.") with the Game Master's writing gone, and the same numbers then appear a second time as log lines directly above it. Nothing tells the player the turn is degraded, and it stays that way after a reload.
Keeping the real results instead of the model's guessed outcome is the intended behaviour and should stay. What this issue asks for is a better-looking failure: don't print the results as the turn's prose when the log already shows them, and tell the player a retry would help.
How to reproduce (try it yourself)
I try to force the rusted gate open.and send.What you'll see: the whole turn is replaced by lines like
Might check (DC 30): [12] = 12. Failure.and3d1+2 = 5, and the Game Master's prose you just watched stream in is gone. The identical results appear again as system log lines directly above that text. No error toast, no retry prompt - the turn just looks like a numbers-only reply, and it is still there after you reload the chat.What should happen: the rolls stay real and nothing guessed survives, but the turn should not read as a duplicated stat dump, and the player should be told the Game Master could not narrate the outcome so they know to swipe or regenerate.
Control: run the same turn without killing the model. The turn is normal prose and each result is shown once, as log lines only.
Deterministic variant, no timing needed: point a
custom(OpenAI-compatible) connection at a small stub server that answers the first request normally (prose plus a[dice: 3d1+2]request) and destroys the socket for any request whose body containsThe engine has now rolled the requested dice. Fires every time.Where it is
packages/server/src/routes/generate.routes.tsat staging52799569c, in the Game-mode roll-resolution block gated at :7937 (chatMode === "game" && !input.impersonate):narration = "";. Nothing is sent to the client, so the stream carries no error frame.narration = narration.replace(createGameRollTagRegex(), "").trim() || resolvedSummary;then :8038 joins it with the record tags. Withnarrationempty, the summary string becomes the turn body.packages/client/src/components/game/GameNarration.tsx:938-975(formatSkillCheckLogContent, call sites :2563 and :2598) renders one system log line per dice roll and per check on every turn - that is where the second copy comes from.What's happening
The summary string is built as a safety net so the real results are never lost. On the failure path it is written into the turn's visible text, and the client strips only the record tags, so the summary is what the player reads as narration. The per-turn log lines then render the same results again. Because the catch sends nothing to the client, the player gets a normal-looking saved turn with no sign that a request failed.
Suggested fix
Keep the rule that no guessed or partial outcome survives, and change only how the failure is presented:
Both halves live in the same catch block and the same fallback line, so they belong in one change. Any change here must also move
scripts/regressions/game-text-dice.regression.ts(its failed-continuation branch asserts the draft prose does not survive and that no error frame is emitted) and the sentence atdocs/game/dice-and-skill-checks.md:74.Context
Introduced deliberately by PR #5979 (merged to staging 2026-09-09), which closed #5956, #5959, #5960 and #5961; #5961 is the closest relative - it is the contradiction bug whose fix produced this fallback, so the draft's prose must not simply be kept. The behaviour is currently intended and documented (
docs/game/dice-and-skill-checks.md:74) and pinned by the regression lane, so this is a request to soften a decided contract, not a broken invariant - please treat the test and doc updates as part of the change rather than closing it as working as designed. Unreleased on staging: v2.4.4 was tagged 2026-08-25, before the merge.Found by an AI-assisted sweep of merged PR #5979 against its original issues, then re-verified against staging
52799569con 2026-09-13. Please verify before fixing.@SpicyMarinara commented on GitHub (Sep 13, 2026):
@SpicyMarinara is taking this report through the issue sweep in draft PR #6137, with Codex assisting. The affected current-code path has been checked; implementation and focused regression verification are in progress.
@SpicyMarinara commented on GitHub (Sep 13, 2026):
Fixed in #6137, now merged to staging (
e044997a2). Failed dice correction preserves actual rolls and shows a retry notice instead of duplicated bare results.