[GH-ISSUE #5902] A model turn that is only a command tag is thrown away in Game Mode #3260

Closed
opened 2026-10-21 06:01:25 +07:00 by bsakaguchi · 2 comments
Owner

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

Originally assigned to: @SpicyMarinara on GitHub.

When the model's whole reply is a command tag and nothing else, stripping the tag leaves an empty
response, and the engine has a path for exactly that: it saves a hidden anchor message so the commands
have something to attach to. But the test that decides whether to save that anchor counts only
Conversation-mode commands. In Game Mode those counters are always zero, so a Game turn that consists
solely of a command is discarded — no message, no swipe, nothing for anything to claim against.

Where it is. The empty-response branch calls shouldSaveHiddenGenerationAnchor at
packages/server/src/routes/generate.routes.ts:7253-7258, passing parsedCommands.length and
parsedRawCommandCount. The gate itself is
packages/server/src/routes/generate/spatial-transition-request.ts:44-54 — it saves only if a spatial
directive was detected or one of those two counters is above zero. Both counters are only ever
incremented inside the block guarded by conversationCommandsEnabled
(generate.routes.ts:6958, populated at :6976), and that flag is
chatMode === "conversation" && chatMeta.characterCommands !== false (:2115). So in Game Mode the
gate can only pass on the spatial-directive branch. When it does not pass, control falls through to
the empty-response error at :7334-7339, which logs a warning, sends the user "The AI returned an
empty response", and returns null before the save block.

Why it matters. Today this mostly shows up as an unexplained "empty response" error when a Game turn
happens to be command-only, which is confusing but rare. It becomes structural the moment Game Mode
gets a command vocabulary of its own — a package-declared verb channel means the model can legitimately
answer a turn with just an instruction, and every such turn would be dropped with an error message the
user cannot act on. The user's mental model is "the GM did something and the app broke", when in fact
the engine understood the turn and then threw it away for having no prose.

The smallest honest fix is to make the anchor gate aware of whatever commands the current mode actually
parses, rather than only the Conversation ones — which means the gate needs a general "the model
emitted something actionable" input instead of two mode-specific counters. Worth deciding alongside
that: whether a prose-less command turn should produce a visible message row at all, or whether the
right answer for Game Mode is a distinct silent-but-saved shape, since the Conversation anchor exists
to carry command attachments and a Game verb may want different anchoring. Whatever the shape, the
current outcome — an error shown to the user for a turn the engine parsed fine — is the part that
should not survive.

Originally created by @kolacheee on GitHub (Sep 6, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5902 Originally assigned to: @SpicyMarinara on GitHub. When the model's whole reply is a command tag and nothing else, stripping the tag leaves an empty response, and the engine has a path for exactly that: it saves a hidden anchor message so the commands have something to attach to. But the test that decides whether to save that anchor counts only Conversation-mode commands. In Game Mode those counters are always zero, so a Game turn that consists solely of a command is discarded — no message, no swipe, nothing for anything to claim against. Where it is. The empty-response branch calls `shouldSaveHiddenGenerationAnchor` at `packages/server/src/routes/generate.routes.ts:7253-7258`, passing `parsedCommands.length` and `parsedRawCommandCount`. The gate itself is `packages/server/src/routes/generate/spatial-transition-request.ts:44-54` — it saves only if a spatial directive was detected or one of those two counters is above zero. Both counters are only ever incremented inside the block guarded by `conversationCommandsEnabled` (`generate.routes.ts:6958`, populated at `:6976`), and that flag is `chatMode === "conversation" && chatMeta.characterCommands !== false` (`:2115`). So in Game Mode the gate can only pass on the spatial-directive branch. When it does not pass, control falls through to the empty-response error at `:7334-7339`, which logs a warning, sends the user "The AI returned an empty response", and returns `null` before the save block. Why it matters. Today this mostly shows up as an unexplained "empty response" error when a Game turn happens to be command-only, which is confusing but rare. It becomes structural the moment Game Mode gets a command vocabulary of its own — a package-declared verb channel means the model can legitimately answer a turn with just an instruction, and every such turn would be dropped with an error message the user cannot act on. The user's mental model is "the GM did something and the app broke", when in fact the engine understood the turn and then threw it away for having no prose. The smallest honest fix is to make the anchor gate aware of whatever commands the current mode actually parses, rather than only the Conversation ones — which means the gate needs a general "the model emitted something actionable" input instead of two mode-specific counters. Worth deciding alongside that: whether a prose-less command turn *should* produce a visible message row at all, or whether the right answer for Game Mode is a distinct silent-but-saved shape, since the Conversation anchor exists to carry command attachments and a Game verb may want different anchoring. Whatever the shape, the current outcome — an error shown to the user for a turn the engine parsed fine — is the part that should not survive.
bsakaguchi 2026-10-21 06:01:25 +07:00
Author
Owner

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

Owner: @SpicyMarinara, assisted by Codex. Taking this issue in the assigned-issue sweep, PR #6007 targeting staging. Existing outside contributor PRs are excluded from the sweep.

<!-- gh-comment-id:5606718575 --> @SpicyMarinara commented on GitHub (Sep 9, 2026): Owner: @SpicyMarinara, assisted by Codex. Taking this issue in the assigned-issue sweep, PR #6007 targeting staging. Existing outside contributor PRs are excluded from the sweep.
Author
Owner

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

Addressed in #6007, merged into staging as 46d184753d. The final CI matrix and CodeRabbit review passed; validation details and manual follow-up checks are in the PR.

<!-- gh-comment-id:5608333854 --> @SpicyMarinara commented on GitHub (Sep 9, 2026): Addressed in #6007, merged into `staging` as 46d184753dc4fc65caf00e982847688b5df59095. The final CI matrix and CodeRabbit review passed; validation details and manual follow-up checks are in the PR.
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#3260
No description provided.