[GH-ISSUE #6117] Roleplay rolls are thrown away on Claude and Grok subscription connections, and the character's made-up outcome is kept #3393

Closed
opened 2026-10-21 06:02:38 +07:00 by bsakaguchi · 2 comments
Owner

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)

  1. Settings -> Connections: add or select a connection whose provider is "Claude (Subscription)". "Grok (Subscription)" behaves the same. Keep an OpenAI or Anthropic API-key connection handy as the control.
  2. Create a character named Mari (Characters -> New; a name alone is enough).
  3. Create a new chat in Roleplay mode with Mari as the only participant, and set the chat's connection to the Claude (Subscription) connection.
  4. Open Chat Settings (gear icon in the chat header) and expand the "Commands" card.
  5. Turn ON the master "Commands" switch, then turn ON "Rolls". Leave the roll audience at its default - if Rolls is restricted to the narrator, the roll is blocked for a non-narrator speaker on every connection, which looks like this bug but is not.
  6. Still in Chat Settings, scroll to Function Calling. The notice reads: "Native tools are unavailable on this connection. Claude and Grok subscriptions only support text commands and dice tags."
  7. Close the drawer and send exactly: 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; then autoAttachToolNames: available ? [ ... ] : [].
  • packages/server/src/routes/generate.routes.ts:5182-5185 - Roleplay attaches roll_dice via autoAttachToolNames when Rolls is on.
  • packages/server/src/routes/generate.routes.ts:6684 and :6973 - responderToolsAttached and 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. :7422 is the branch that runs instead, and it has no roll handling.
  • packages/server/src/routes/generate.routes.ts:7544-7546 and :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 for claude_subscription and grok_subscription.
  • Copy that promises the behaviour: packages/client/src/localization/locales/en.json:438 (rendered by packages/client/src/features/chat-settings/sections/FunctionCallingSection.tsx:133) and docs/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, resolveGenerationTools correctly 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 inherited chatComplete, 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.ts stays 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_subscription connection 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:438 and docs/extending/custom-tools.md:17 must 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 52799569c on 2026-09-13. Please verify before fixing.

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) 1. Settings -> Connections: add or select a connection whose provider is "Claude (Subscription)". "Grok (Subscription)" behaves the same. Keep an OpenAI or Anthropic API-key connection handy as the control. 2. Create a character named Mari (Characters -> New; a name alone is enough). 3. Create a new chat in Roleplay mode with Mari as the only participant, and set the chat's connection to the Claude (Subscription) connection. 4. Open Chat Settings (gear icon in the chat header) and expand the "Commands" card. 5. Turn ON the master "Commands" switch, then turn ON "Rolls". Leave the roll audience at its default - if Rolls is restricted to the narrator, the roll is blocked for a non-narrator speaker on every connection, which looks like this bug but is not. 6. Still in Chat Settings, scroll to Function Calling. The notice reads: "Native tools are unavailable on this connection. Claude and Grok subscriptions only support text commands and dice tags." 7. Close the drawer and send exactly: `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;` then `autoAttachToolNames: available ? [ ... ] : []`. - `packages/server/src/routes/generate.routes.ts:5182-5185` - Roleplay attaches `roll_dice` via `autoAttachToolNames` when Rolls is on. - `packages/server/src/routes/generate.routes.ts:6684` and `:6973` - `responderToolsAttached` and 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. `:7422` is the branch that runs instead, and it has no roll handling. - `packages/server/src/routes/generate.routes.ts:7544-7546` and `: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 for `claude_subscription` and `grok_subscription`. - Copy that promises the behaviour: `packages/client/src/localization/locales/en.json:438` (rendered by `packages/client/src/features/chat-settings/sections/FunctionCallingSection.tsx:133`) and `docs/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, `resolveGenerationTools` correctly 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 inherited `chatComplete`, 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.ts` stays 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_subscription` connection 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:438` and `docs/extending/custom-tools.md:17` must 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 52799569c on 2026-09-13. Please verify before fixing.
bsakaguchi 2026-10-21 06:02:38 +07:00
Author
Owner

@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.

<!-- gh-comment-id:5651922625 --> @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.
Author
Owner

@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.

<!-- gh-comment-id:5652782022 --> @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.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#3393
No description provided.