mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #3427] [Issue]: Turn-game bot narration leaks model chain-of-thought as the character's chat message #1854
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#1854
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 @Romuromylus on GitHub (Jul 10, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3427
Originally assigned to: @Romuromylus on GitHub.
Summary
Turn-game bot narration (character table talk and dealer/announcer lines) saves the model's chain-of-thought as the character's chat message when the connected model emits inline reasoning (e.g. a leading
<think>block). With a reasoning-heavy model, the shortmaxTokensbudget is often consumed entirely by the reasoning, so the persisted message is a truncated meta monologue instead of a spoken line.Expected behavior
After a bot move (UNO, chess, poker, 8-ball), the character speaks one short in-character line; the announcer voices one short announcement. Inline reasoning from the model is never persisted or shown, matching how the main generation pipeline strips leading thinking blocks before saving.
Actual behavior
The character's message in chat reads like this (real example, truncated mid-sentence by the 100-token cap):
Steps to reproduce
content(a leading<think>/<thinking>block) rather than a provider-native thinking channel./pokeror another turn-game command) and make a move so the bot takes its turn.Environment
a624b957)Logs, screenshots, or video
See the quoted chat message above (bot seat "Rias Gremory" during an 8-ball game; identical mechanism applies to poker/chess/UNO narration and dealer announcements).
Additional context
Root cause:
narrateOutcome()andnarrateAnnouncements()inpackages/server/src/services/turn-games/turn-game-bot-runner.service.tsreturnres.contentverbatim, while the generation pipeline (e.g.generate.routes.ts,game.routes.ts) runs model output throughextractLeadingThinkingBlocks()before persisting. Two compounding factors:maxTokens: 100/120is routinely exhausted by the reasoning itself, so the closing tag never arrives and the message is truncated mid-thought — even a strip of closed blocks would not recover a spoken line in that case (the correct behavior is falling back to the factual event summary, which both call sites already support for empty narration).The bot move call is unaffected (it only consumes
res.toolCalls).Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:
@SpicyMarinara commented on GitHub (Jul 10, 2026):
Fixed in #3419 and merged to staging.