mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #6121] Adding the lorebook search tool by hand to a Game chat does nothing, and the panel still claims it is available #3398
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#3398
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/6121
Originally assigned to: @SpicyMarinara on GitHub.
In a Game chat, the function picker still offers
search_lorebookand lets you add it to the chat's tool list, and the panel still says all enabled tools are available - but the server strips that tool out of every Game turn unless "Let the GM search lore" is on. The tool sits in the list looking live and never runs, with nothing saying it was withheld.How to reproduce (try it yourself)
searchin the picker.search_lorebookis offered with no "unavailable here" marker. Tick it and add it - it now sits in the chat's active function list styled like any working tool.search_lorebookas the only entry in that list, also turn on Force to Call Tool, then send any message.What you'll see: the turn cannot use
search_lorebook- the server resolved this chat's tool set down toroll_dicealone and dropped the tool you explicitly picked. No message, badge, or tooltip says it was removed. (Compareupdate_about_me, the other mode-restricted built-in: the picker correctly hides it outside Conversation.)What should happen: if a tool cannot run in this mode, the picker should not offer it and the list should not show it as active - or, if it is offered, an explicit choice should be honoured or visibly refused. And the "All globally enabled tools are available to this chat" line should not be shown in a state where it is false.
Where it is
At staging
52799569c:packages/server/src/services/generation/tool-resolution-runtime.ts:768-770- the Game filter:if (toolDefs && agentContext.chatMode === "game" && !booleanText(chatMetadata.gameLorebookSearch)) { toolDefs = toolDefs.filter((toolDef) => toolDef.function.name !== "search_lorebook"); }packages/server/src/services/generation/tool-resolution-runtime.ts:751-760- the per-chatactiveToolIdsselection is applied inloadToolDefinitionsbefore that filter, so an explicit pick is discarded afterwards.packages/client/src/components/chat/ChatSettingsDrawer.tsx:2349-2353-availableToolsskips onlyupdate_about_mewhen not in Conversation.packages/client/src/features/chat-settings/sections/FunctionCallingSection.tsx:179-182- renders "All globally enabled tools are available to this chat" whenever the chat's tool list is empty.What's happening
The mode restriction is enforced on the server only. The client already has the right pattern for this situation - it hides
update_about_meoutside Conversation, with a comment saying it should not look available where it cannot run - butsearch_lorebookwas never added to that filter. And because the user's per-chat selection is resolved before the Game filter runs, picking the tool by hand does not override the restriction; it just disappears.Suggested fix
Extend the existing client-side mode filter so
search_lorebookis hidden (or shown disabled with a reason) in Game chats while "Let the GM search lore" is off, and suppress or qualify the "all globally enabled tools are available" line in that state. Separately, decide what an explicit selection means: either honour a hand-pickedsearch_lorebookas equivalent to turning the switch on, or surface why it was dropped - silently discarding a choice the user made by hand is the worst of the three options. Server-side enforcement should stay as the backstop.If the fix is instead to restore the old default, note that
scripts/regressions/game-tool-controls.regression.ts:306-311asserts the current behaviour, so that route means rewriting a maintainer-written assertion - worth a deliberate decision rather than a green-lane edit.Context
Introduced by merged PR #5982 (commit
5e41bf8ff, 2026-09-09), implementing issue #5955 and also closing #5957/#5958. Unreleased on staging - the latest release tag is v2.4.4, whose tool resolution file has no Game filter at all. The gate itself is intended; this is about the client advertising a tool the server will not run and about the discarded explicit selection. One more thing belongs with this change rather than in its own issue: the withdrawal is undisclosed.CHANGELOG.md:104describes the new switch as a pure addition and the[Unreleased]"### Changed" block (CHANGELOG.md:147) has no line saying Game chats now need "Let the GM search lore" for lorebook lookups even with Tool Use on, so anyone upgrading from v2.4.4 (where the tool was available in Game chats) sees the Game Master quietly stop looking things up. One "Changed" line in the same shape as the existing "Existing non-English users reselect their language once after upgrading" entry, and the same sentence on the Game getting-started page and the custom-tools page, would close that gap.Found by an AI-assisted sweep of merged PR #5982 against issue #5955, then re-verified against staging
52799569con 2026-09-13. Please verify before fixing.@SpicyMarinara commented on GitHub (Sep 13, 2026):
@SpicyMarinara is taking this report through the issue sweep in draft PR #6137, with Codex assisting. The affected current-code path has been checked; implementation and focused regression verification are in progress.
@SpicyMarinara commented on GitHub (Sep 13, 2026):
Fixed in #6137, now merged to staging (
e044997a2). Game tool controls now reflect the actual lore-search permission and explain when it is unavailable.