mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #6950] [MERGED] fix(roleplay): honor Function Calling's roll_dice without the Rolls command #7397
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#7397
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/6950
Author: @SpicyMarinara
Created: 10/1/2026
Status: ✅ Merged
Merged: 10/1/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/roleplay-function-calling📝 Commits (2)
e27c225fix(roleplay): honor Function Calling's roll_dice without the Rolls commandaa4ee65test(roleplay): surface fake provider errors in the function calling regression📊 Changes
3 files changed (+176 additions, -1 deletions)
View changed files
📝
CHANGELOG.md(+2 -0)📝
packages/server/src/routes/generate.routes.ts(+5 -1)➕
scripts/regressions/roleplay-function-calling.regression.ts(+169 -0)📄 Description
Linked issue
Closes #6945
Why this change
In Roleplay, adding
roll_diceunder Function Calling did nothing: the model never saw the tool, and even a forced<tool_call>was saved as plain text. It only worked through Agents → Commands → Rolls.The settings were saved fine. On the server, Roleplay offered
roll_diceonly while the Rolls command was on. That gate came in with narrator-only rolls (#5990), and it threw away the copy Function Calling had already attached.What changed
generate.routes.ts: while Rolls is on, it still decides who may roll, including its narrator-only choice. When it's off, aroll_dicethat the chat's Function Calling attached is offered and runs through the same Roleplay roll code: modifiers, dice card and the saved roll.roleplay-function-calling.regression.ts. It runs the real generate route against a fake KoboldCPP-style endpoint that answers with the reporter's exact<tool_call>text.Not changed: with streaming on and a model that writes tool calls as text, the raw
<tool_call>text can stay at the start of the saved reply. That happens with the Rolls command too, so it's a separate bug.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
What I ran (not a replacement for the checklist):
pnpm checkandpnpm regression:promptpass.<tool_call>was saved as the reply. It passes with the fix: the tools list is["roll_dice"], the roll runs and is saved, and the dice card shows.search_lorebookdoesn't offerroll_dice. Rolls set to "Narrator" still keeps other speakers from rolling.To check by hand:
roll_dice, and ask a character to roll. Confirm a dice card appears.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)CHANGELOG only.
docs/extending/custom-tools.mdalready describes this behavior.UI evidence (if applicable)
Server-side fix; no UI changes.
Summary by CodeRabbit
roll_diceis selected, returning the result to the model.roll_dicein the chat tools allows the roll.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.