mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #5984] [MERGED] fix: report actual tool write outcomes and show failures #7015
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#7015
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/5984
Author: @SpicyMarinara
Created: 9/9/2026
Status: ✅ Merged
Merged: 9/9/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/game-tool-outcomes-5898-5901📝 Commits (7)
1df6319chore: reserve tool outcome honesty issue sweep573c648fix: report stored Game tool outcomes and surface refusalsfb351acfix: save Game tool changes on the generated message and swipe68c6e3dMerge branch 'fix/capability-persistence-permissions-5899' into fix/game-tool-outcomes-5898-5901a928a67Merge remote-tracking branch 'origin/staging' into fix/game-tool-outcomes-5898-5901a1867b1fix: preserve authoritative locations in tool-created snapshots163fca6Merge remote-tracking branch 'origin/staging' into fix/game-tool-outcomes-5898-5901📊 Changes
10 files changed (+554 additions, -66 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)➕
e2e/game-tool-outcomes.e2e.ts(+109 -0)📝
packages/client/src/hooks/use-generate.ts(+21 -1)📝
packages/client/src/localization/locales/en.json(+3 -0)📝
packages/server/src/routes/generate.routes.ts(+57 -36)📝
packages/server/src/services/storage/game-state.storage.ts(+35 -0)📝
packages/server/src/services/tools/tool-executor.ts(+19 -8)📝
packages/shared/src/features/function-calls/tools/update-game-state/manifest.ts(+2 -4)📝
scripts/regressions/game-mode-dice-tool.regression.ts(+28 -17)➕
scripts/regressions/game-tool-outcomes.regression.ts(+279 -0)📄 Description
Linked issue
Closes #5898. Closes #5901.
Why this change
A Game tool could tell the model a location or time change was applied before storage ran, even when a lock, missing snapshot, or Spatial Context ownership prevented the write. Tool refusals also disappeared unless debug mode was enabled.
What changed
Keep the existing location/time surface. During model tool rounds, valid requests receive an explicit pending receipt. After the response is saved, reuse the existing message/swipe snapshot writer and report the actual stored result to the client. The lock check and write share one transaction and recheck the current lock state. Earlier turns and sibling swipes stay unchanged; unsaved responses apply nothing. Tool-only turns reuse the hidden command anchor. Unavailable, unsupported, failed, and Spatial Context-owned writes return refusals. Removed unused target/key schema fields.
Failed or denied tool results now use the existing error notification in every chat mode. Repeated failures from the same tool share a notification, and only a short error explanation is shown. Raw results remain in debug output; existing dice cards are preserved.
Validation
Passed
pnpm check,pnpm regression:prompt, the existing Game dice-tool regression, and the newgame-tool-outcomes.regression.ts. The new proof fails against the old executor's false applied receipt and passes with the fix. It exercises actual file storage and the Fastify generation route, with only the model transport stubbed: accepted writes, locks, missing snapshots, Spatial Context ownership, storage failure, unsupported types and invalid receipts. CodeRabbit's snapshot-targeting finding was reproduced against the first implementation. The added proof covers new messages, regenerations, continuations, command-only anchors, failed narration, and a lock added between planning and saving. It verifies pending model receipts, final applied/refused events, and preserved earlier snapshots. Clock-only writes also retain Spatial Context's projected location when cloning a snapshot, while an existing target location remains unchanged.Passed all 9 browser cases across Game, Roleplay and Conversation on desktop Chromium, mobile Chromium and mobile WebKit with debug disabled. Checked concise error text, notification deduplication and both themes; inspected captured mobile screenshots. Browser notification tests inject SSE fixtures; the server regression separately verifies the actual generation route and saved state. Screenshots are attached to the browser test artifacts.
Docs and release impact
Added an Unreleased entry and localized notification copy. No new state schema or optional-package changes; no claim of live provider or physical-device testing.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.