mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #5982] [MERGED] feat: give Game chats explicit tool and lore-search controls #7014
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#7014
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/5982
Author: @SpicyMarinara
Created: 9/9/2026
Status: ✅ Merged
Merged: 9/9/2026
Merged by: @SpicyMarinara
Base:
staging← Head:feat/game-tool-controls-5955-5957-5958📝 Commits (10+)
67f7646chore: reserve Game tool controls issue sweep5e41bf8feat: add independent Game tool planning and semantic lore search5fc8d8dMerge remote-tracking branch 'origin/staging' into feat/game-tool-controls-5955-5957-5958f200c93fix: preserve Agent lore search fallback and regression coverage6614ed9fix: clarify Game tool controls and reuse connection flags0385f6cMerge branch 'fix/game-dice-results-5956-5961' into feat/game-tool-controls-5955-5957-595849e42f7Merge remote-tracking branch 'origin/staging' into feat/game-tool-controls-5955-5957-59589e650dffix: keep stacked dice history readable and translation-safe5eb670aMerge branch 'fix/game-tool-outcomes-5898-5901' into feat/game-tool-controls-5955-5957-5958b8fd87atest: cover deferred state writes from a separate Game planner📊 Changes
18 files changed (+931 additions, -104 deletions)
View changed files
📝
CHANGELOG.md(+3 -1)📝
docs/extending/custom-tools.md(+4 -0)📝
docs/game/getting-started.md(+21 -13)📝
e2e/game-native-dice.e2e.ts(+35 -0)➕
e2e/game-tool-controls.e2e.ts(+130 -0)📝
packages/client/src/components/chat/ChatSettingsDrawer.tsx(+20 -0)📝
packages/client/src/components/game/GameNarration.tsx(+25 -15)📝
packages/client/src/features/chat-settings/sections/FunctionCallingSection.tsx(+76 -2)📝
packages/client/src/localization/locales/en.json(+10 -2)📝
packages/server/src/routes/generate.routes.ts(+126 -58)➕
packages/server/src/services/generation/game-tool-planning.ts(+62 -0)📝
packages/server/src/services/generation/tool-resolution-runtime.ts(+60 -6)📝
packages/shared/src/constants/providers.ts(+5 -0)📝
packages/shared/src/features/function-calls/tools/search-lorebook/manifest.ts(+6 -2)📝
packages/shared/src/types/chat.ts(+4 -0)➕
scripts/regressions/game-tool-controls.regression.ts(+341 -0)📝
scripts/regressions/maintenance-lifecycle.regression.ts(+2 -4)📝
scripts/regressions/roleplay-streaming.regression.ts(+1 -1)📄 Description
Linked issue
Closes #5955. Closes #5957. Closes #5958. Completes the stacked dice-history review follow-up from #5979 (#5956).
Why this change
Game players could only obtain lore searches by enabling the whole optional tool set, and the search matched literal text. There was no cheaper connection for tool planning. Claude and Grok subscription connections also accepted the tool toggle while ignoring the native tool schema.
What changed
Validation
Completed automated proof:
pnpm check(localization, formatting, TypeScript, ESLint, build, browser-test types) andpnpm regression:prompt.game-tool-controls.regression.tsuses real Fastify/file storage with only model/embedding transports replaced. It covers Claude, Grok, and Gemini narration; separate budgets and usage; real dice; denied calls; no-call plans; missing/failed connections; subscription bypass; semantic ranking; disabled entries; vector prerequisites; and independent tool resolution. The isolation assertion caught a shared-array mutation leaking tool history; a copied loop array made it pass.The combined planner-and-text-dice regression reproduced a lost-context fallback and now verifies the complete rewrite retains planner results. The stacked-history browser assertion reproduced the misplaced translation controls. After integrating #5984, a separate-planner state-write case verifies the pending receipt, saved narration snapshot, and untouched earlier state. All nine dice/history browser cases pass, including both log views and translated display.
Existing
game-mode-dice-tool.regression.ts, manual Agent retry/tool parity, maintenance lifecycle and Roleplay streaming regressions passed. The retry proof caught an unintended vector requirement on Agent tools; their existing text fallback is preserved.The complete Linux Node regression suite passed in CI. The full local macOS run passed 236/238, with failures in the unmodified Mari store-link and writer-lease platform fixtures; neither those regressions nor their implementation files differ from staging.
Six browser cases passed across desktop Chromium, mobile Chromium, and mobile WebKit in light and dark themes. They verify unavailable subscription controls, the connection choice, independent lore-search persistence, reloads, and a deleted override. An added imported-connection regression reproduced an image default masking the subscription narrator's availability; the lookup now reuses the existing filtered chat-connection list. The mobile screenshot was inspected.
pnpm checkpasses locallyContainer (Docker / Podman) built and ran without issue
Ran the app, clicked through the changes manually
Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
Above manual verification completed (describe below)
Read and followed
CONTRIBUTING.mdManual verification notes
Manually verify tool selection quality, latency, and actual billing with a live paid tool connection and subscription narrator. Check the controls on a physical mobile device and try a long personal campaign. Automated transport fixtures verify routing and isolation, not live model quality.
Docs and release impact
Added an Unreleased entry and canonical English UI keys. Updated
docs/game/getting-started.mdanddocs/extending/custom-tools.md; translation follow-up #5983 tracks every language pack ondocs-i18n. No version bump or new dependency.UI evidence (if applicable)
e2e/game-tool-controls.e2e.tsproduces light/dark viewport captures. Existing settings switch, select, and section styles are reused.Summary by CodeRabbit
New Features
Bug Fixes
Documentation
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.