mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #6117] Roleplay rolls are thrown away on Claude and Grok subscription connections, and the character's made-up outcome is kept #3393
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#3393
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/6117
Originally assigned to: @SpicyMarinara on GitHub.
On a Claude or Grok subscription connection, a Roleplay chat with the Rolls command turned on never actually rolls. The character asks for a roll, the engine silently drops the request, and the message you end up with contains an outcome the character invented - no dice card, no roll in the message's command activity, and nothing saying a roll was requested and discarded. The same chat on an API-key connection rolls correctly.
How to reproduce (try it yourself)
I try to pick the lock on the vault door. Roll for it, and do not tell me the outcome until the dice land.What you'll see: Mari's reply streams a sentence, stops mid-beat, and the finished message contains an outcome she made up ("the lock springs open"). There is no dice card, and the message's command activity holds no roll. Nothing distinguishes "no roll was asked for" from "a roll was asked for and thrown away". A model does not ask for a roll every turn, so this may take two or three sends - but it is being asked to: the roll instruction is added to the prompt whenever Rolls is on, with no check for whether the connection supports tools.
What should happen: the same as on an API-key connection. Switch the chat's connection to an OpenAI or Anthropic API-key connection, leave Rolls on, and send the same message: a dice card renders (for example
1d20+3 (Mari · Pick the lock): [17] +3 = 20), the roll is stored in the message's command activity, and the narration continues from the rolled total instead of an invented one.Where it is
At staging
52799569c:packages/server/src/services/generation/tool-resolution-runtime.ts:1082-1096-resolveGenerationTools:const available = args.nativeToolsAvailable !== false;thenautoAttachToolNames: available ? [ ... ] : [].packages/server/src/routes/generate.routes.ts:5182-5185- Roleplay attachesroll_diceviaautoAttachToolNameswhen Rolls is on.packages/server/src/routes/generate.routes.ts:6684and:6973-responderToolsAttachedand the tool-loop entry it gates.packages/server/src/routes/generate.routes.ts:7112-7141- the only place a text roll request is parsed and turned into a real roll; it lives inside that loop.:7422is the branch that runs instead, and it has no roll handling.packages/server/src/routes/generate.routes.ts:7544-7546and:7552- the roll request is stripped from the saved message and the activity entry is skipped with the comment "Recorded with its actual tool result" (it was not).packages/shared/src/constants/providers.ts:21-23-supportsNativeToolCalls()returns false forclaude_subscriptionandgrok_subscription.packages/client/src/localization/locales/en.json:438(rendered bypackages/client/src/features/chat-settings/sections/FunctionCallingSection.tsx:133) anddocs/extending/custom-tools.md:17("Their text commands and dice tags remain available.").What's happening
One flag is doing two jobs. When a connection cannot take native tool schemas,
resolveGenerationToolscorrectly stops sending schemas - and also empties the auto-attach list. But that list is the only thing that pulls a Roleplay turn into the tool loop, and the loop is the only place the engine reads a written roll request out of the narration and rolls for real. Subscription connections used to reach the loop through the inheritedchatComplete, which returns plain content with an empty tool-call list, which is all the text path ever needed. With the list emptied, the loop is skipped, the plain-narration branch runs, the roll request is stripped from the saved message, and the character's invented result is what gets saved. Game Mode's written dice tags survive on these connections because they are resolved after generation, outside the tool loop (generate.routes.ts:7938-7960); Roleplay's roll is the only text command still routed through the loop.scripts/regressions/roleplay-commands.regression.tsstays green because it tests the parser and the stream filter as units and never drives the generate route with a subscription connection.Suggested fix
Separate the two jobs behind that flag. Not serializing native tool schemas to a transport that ignores them is correct and should stay; it should not also empty
autoAttachToolNames, which is what routes the text-resolved roll. Either gate the auto-attach list on tool availability only for chat-tool attachments, or - probably cleaner and more consistent - lift the Roleplay roll out of the tool loop entirely and resolve it after generation the way Game Mode's dice tags already are. Either way, a roll that genuinely cannot be resolved must say so in the turn (the existing roll-limit notice already exists for this) rather than silently stripping the request and keeping the invented number.Land a regression in the same change that posts to the generate route on a
claude_subscriptionconnection and asserts a real roll comes back from a written roll request; the current lane is unit-only, which is why this shipped unnoticed. If instead the decision is that Roleplay rolls stay unavailable on subscription connections, the fix is the copy:en.json:438anddocs/extending/custom-tools.md:17must stop promising text commands work there, and the request still must not be silently dropped.Context
The Roleplay Rolls feature came in with PR #5970; the gate that breaks it came in with PR #5982, which fixed issue #5958. #5958 explicitly scoped itself to native tool calls and said the text-parsed paths "keep working for these users" - Roleplay's roll is a text-parsed path, so this is an unintended side effect, not the requested change. Neither PR is in any release tag (latest release is v2.4.4), so this is unreleased on staging and no shipped user can hit it yet - but it should be fixed before the next release, since the failure is invisible in the transcript and will otherwise be reported as "the model keeps inventing results". Two smaller things belong in the same change rather than separate issues: the missing route-level regression, and the settings/doc copy, whose truth depends on which way this is resolved.
Found by an AI-assisted sweep of merged PR #5982 against issue #5958, 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). Subscription connections preserve Engine text dice without advertising unsupported native tools.