mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #5703] [MERGED] fix(game): stop claiming the Game Master is writing after the tokens stop #6893
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#6893
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?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/5703
Author: @Gunterlie
Created: 8/31/2026
Status: ✅ Merged
Merged: 8/31/2026
Merged by: @Gunterlie
Base:
staging← Head:fix/game-mode-writing-status-5692📝 Commits (8)
2d765c3fix(game): stop claiming the Game Master is writing after the tokens stopfefcb8ffix(game): drive the narration status from message_saved, not a token-idle timerbdb5216Merge branch 'staging' into fix/game-mode-writing-status-56922274611Merge branch 'staging' into fix/game-mode-writing-status-56926076791fix(game): scope the narration phase flag to the live stream and each group turn0e73094Merge branch 'staging' into fix/game-mode-writing-status-56920b03189Merge branch 'staging' into fix/game-mode-writing-status-5692580e65afix(game): guard the group-turn phase reset by stream ownership📊 Changes
4 files changed (+108 additions, -7 deletions)
View changed files
📝
packages/client/src/components/game/GameNarration.tsx(+26 -6)📝
packages/client/src/hooks/use-generate.ts(+20 -0)📝
packages/client/src/stores/chat.store.ts(+24 -1)➕
scripts/regressions/game-narration-phase.regression.ts(+38 -0)📄 Description
Closes #5692
Why
In Game Mode the status line said "The Game Master is writing the next segment..." for the whole generation request. But the request stays open well past the last narration token: the server saves the assistant message, then post-processing agents run, the client refreshes messages, and only then does sidecar scene analysis start. With a fast local model that gap is most of the turn, so users watched an idle CPU while the UI insisted text was being generated.
Unlike Roleplay, Game Mode cannot release
isStreamingonassistant_message_ready— the segment-by-segment narration reveal depends on the stream staying live — soisStreamingalone cannot tell "the model is writing" apart from "the model is done and the turn is being assembled".What
The server already sends the exact signal:
message_savedfires the moment the narration row is durable. Game generations now record that in a per-chatnarrationSavedChatIdsflag on the chat store, and the status line reads it — writing label before, the existing "Preparing scene…" label after.The flag follows the same lifecycle as the neighbouring
backgroundIllustrationChatIds: cleared when a new generation takes the chat's abort controller, and cleared byclearPerChatStateon teardown.No new locale keys.
Scope note
This makes the status truthful. It does not shorten the gap itself — reducing the post-generation latency means reordering the server-side post-processing and scene-analysis handoff, which is a separate change.
Test plan
pnpm checknode scripts/run-regressions.mjs(addsgame-narration-phase, pinning that every teardown path clears the flag — a missed clear would strand the next turn on "Preparing scene…")Summary by CodeRabbit
New Features
Bug Fixes
Tests
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.