mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #5898] update_game_state tells the model a change was applied when four of its six change types are written nowhere #3255
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#3255
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 6, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5898
Originally assigned to: @SpicyMarinara on GitHub.
The built-in
update_game_statetool accepts six change types and always answersapplied: true, butonly two of them —
location_changeandtime_advance— are ever written to anything.stat_change,inventory_add,inventory_removeandquest_updateare echoed back to the model as successes andthen dropped. On a chat owned by an Experience package in Game Mode,
location_changeis deliberatelyignored too, so
time_advanceis the only type on that path that does anything at all. Nothing tellsthe model, the user, or the log that the other changes went nowhere.
Where it is. The tool's own handler is a pass-through stub that validates nothing and returns
applied: truefor whatevertype/target/key/valuethe model supplied(
packages/server/src/services/tools/tool-executor.ts:526-539, comment: "Returns the updateinstruction — the client/agent pipeline applies it"). The only place that actually persists anything
is
packages/server/src/routes/generate.routes.ts:6595-6628, which mapslocation_change → locationand
time_advance → timeintogameStateStore.updateLatest()and emits agame_state_patchSSE.The four remaining enum values (declared at
packages/shared/src/features/function-calls/tools/update-game-state/manifest.ts:12) appear in noother write path — the
quest_updatehits elsewhere ingenerate.routes.ts:9340belong to the QuestTracker agent result pipeline, which is a different mechanism with a different payload. The
Experience suppression is
generate.routes.ts:6604-6611, which logs at debug and drops the location.The tool is on by default whenever tool use is enabled: it is in neither the agent-only set
(
packages/server/src/services/generation/tool-resolution-runtime.ts:111-118) nor the default-off set(
:126), andisChatToolEnabledByDefault(:128-130) is what an unfiltered chat is filtered by(
:450), so a plain "Enable Tool Use" with no per-chat filter offers it. To see it: turn on tool usein a Game chat and ask the GM to give you an item or raise a stat. With debug mode on you will watch
the call go out and come back
applied: true; the inventory and the stats do not move.Why it matters. The model is being lied to about its own effects, and it acts on the lie — it will
narrate the sword you now own and the strength you just gained, then keep referring to both, while the
HUD and the saved game state never heard about either. The player sees the story and the sheet drift
apart with nothing to explain it, and there is no error, no warning line, and no user-visible signal
that a change was discarded. It is also the exact failure the write-back channel in #5798 is designed
to avoid, sitting in the tree as a shipped counter-example.
The smallest honest fix is to stop declaring what the engine does not do, which means deciding one
question first: are the four missing types supposed to be persisted, or were they always aspirational?
If they are meant to work, they need real write paths and real targets —
target/keyare free-formstrings today with nothing checking that they name anything that exists. If they were never going to
work, the enum should shrink to the two that do, so the model is offered a tool whose whole surface is
honest. Either way the pass-through
applied: trueshould stop being unconditional: a type the serverdoes not handle should come back as a refusal the model can read, not a success. A related PR narrows
the enum to
location_change+time_advanceas a stopgap; the persist-or-delete decision is thisissue's, not that PR's.
@SpicyMarinara commented on GitHub (Sep 9, 2026):
@SpicyMarinara owns the remaining persistence-honesty work in draft #5984. I am keeping the two supported location/time updates, removing the optimistic applied receipt, and returning a refusal for unavailable, locked, or Experience-owned writes.