mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #6151] A Game Master command with a bad argument reports an empty AI response instead of saying it was refused #3424
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#3424
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/6151
Originally assigned to: @SpicyMarinara on GitHub.
In Game Mode, when the AI's entire reply is one Game Master command and one of its arguments is not an allowed value, the turn disappears and a red error says the AI returned an empty response. The engine actually recognised the command and knows exactly why it refused it, but that reason only reaches the server log, so the player is told something that did not happen.
How to reproduce (try it yourself)
weathercommand whosewordargument must be one of fair, overcast, rain, storm, snow.[weather:{"word":"bogus"}]and nothing else. A real model produces this on its own when it reaches for an off list word like "sunny", since the engine advertises the command and its allowed values in the format reminder.I look at the skyand send.What you'll see: a red toast reading
The AI returned an empty response (finish reason "stop"). Try sending your message again.No new message appears in the chat, and the weather never changes. The only place the real reason exists is the server log:[capability/gm-verbs] Verb weather refused: argument "word" is not one of fair|overcast|rain|storm|snow.What should happen: the player should be told that the weather command was refused and why, rather than being told the AI sent nothing back.
The same thing happens with
[weather:{}](a required argument missing) and with other commands, for example[standing:{"npc":"Mira","stance":"besties"}], so it is not specific to weather. It only happens when the refused command is the whole reply: if any prose sits alongside it, or a second command in the same reply does validate, the turn saves normally.Where it is
At staging
ac14dd704:packages/server/src/services/capability-packages/capability-gm-verb-runtime.service.ts,parseAndStripGmVerbCalls, lines 292 to 297. A name match strips the tag from the narration; whenvalidateGmVerbArgsfails, the code logs a warning and returns"".calls.push({ verb, args: validated.args })on line 297 is only reached when validation succeeds.packages/server/src/routes/generate.routes.ts:8149-8158, wherehasActionableOutputcountscollectedGmVerbCalls.length, which is zero for a refused command.packages/server/src/routes/generate.routes.ts:8248, which sends theemptyResponseMessageerror frame. The client turns it straight into a toast atpackages/client/src/hooks/use-generate.ts:3082-3091.What's happening
The parser removes a recognised command tag from the reply text whether or not its arguments pass validation, but it only records the command when validation passes. So a reply that is nothing but a refused command becomes empty text with zero recorded commands. The route then sees no text, no media and no commands, decides the model produced nothing useful, and sends the generic empty response error. The refusal reason is consumed by a server side warning that no player will ever read.
Suggested fix
Carry refusal reasons out of the parser instead of only logging them. Have the verb parser return the refusals next to the accepted calls, then count a refusal as real output so the turn stops falling into the empty response path, and surface the reason in plain language. The pattern used for dice in PR #6137 is the closest precedent:
dice.service.tsnow returns anunresolvedlist alongside its warning andgenerate.routes.tsfeeds that list back into the follow up prompt so the reason reaches the player through narration. Game Master commands have no second model call to attach that to, so the choice here is a design call: show a plain notice naming the refused command and the allowed values, save the turn with that notice attached, or re-ask the model once with the refusal explained. Any of those is better than the current outcome, where an accurate diagnosis exists inside the process and a misleading one reaches the person.Context
The empty response gate this sits behind arrived with PR #6007, which closed #5902 ("A model turn that is only a command tag is thrown away in Game Mode"). The silent strip on a refused command predates that and shipped with the capability verb runtime in #5922, so that half is in shipped builds; the exact shape described here needs #6007, which landed after v2.4.4 and is unreleased on staging. PR #6137 did not touch either site: the verb runtime file has no commits since the previous head, and the
hasActionableOutputgate still blames to #6007. The closest relative is #6128, the dice version of the same shape, which #6137 fixed. The regression lanescripts/regressions/capability-gm-verb-runtime.regression.tspins only "a parsed command only turn gets a hidden anchor" and "empty and unrecognized output still errors", so it passes with this defect live.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.