[GH-ISSUE #947] [Issue]: Roleplay user-message regenerate works with OpenAI but can return empty response with Gemini #460

Closed
opened 2026-10-20 17:29:06 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @Minsklatte on GitHub (May 17, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/947

Summary

In Roleplay mode, normal user-authored messages expose the Regenerate/Reroll action. After deleting the latest assistant message, using that action on the now-bottommost user message fails with Gemini, while the same
flow appears to work with GPT-5.5.

Expected behavior

Either normal user-authored Roleplay messages should not show Regenerate/Reroll unless they have replay metadata, or regenerating them should work consistently across providers, including Gemini.

Actual behavior

With a Gemini model, clicking Regenerate/Reroll on a normal user message produces:

The AI returned an empty response. Try sending your message again.

With GPT-5.5, the same flow appears to regenerate the user message successfully, so this may be a provider-specific prompt/payload-shaping issue rather than only a UI affordance issue.

Steps to reproduce

  1. Open a Roleplay chat.
  2. Use a Gemini model.
  3. Send a normal user message and receive an assistant response.
  4. Delete the latest assistant response.
  5. The latest/bottommost visible message is now the user message.
  6. Click Regenerate/Reroll on that user message.

Environment

  • Marinara Engine version: 1.6.0
  • Install type: source
  • OS + version: Arch Linux Latest + Android Cinnamon Bun (17)
  • Browser or app shell: Browser + app shell

Logs, screenshots, or video

Error shown in the UI:

The AI returned an empty response. Try sending your message again.

Additional context

I retried the same flow with GPT-5.5 and it appeared to work, which makes me suspect this is related to provider-specific payload construction.

My guess is that regeneration sends regenerateMessageId and excludes the target message from context. That works naturally for assistant-message swipes. But when the target is the latest user message, excluding it may
leave the remaining prompt ending on a previous assistant/model turn.

That may be tolerated by OpenAI/GPT-5.5, but Gemini’s native adapter maps assistant messages to role: "model" and user messages to role: "user", so the Gemini request may end up without the expected latest user turn
and return no visible text.

Conversation mode appears to guard this case by allowing regenerate on user messages only when generation replay metadata exists. Roleplay may need the same guard, unless regenerating normal user messages is intended.

I’d be happy to make a PR for this, but I’m not sure which behavior is intended:

  • hide Regenerate/Reroll on normal user-authored Roleplay messages, matching Conversation mode’s guard, or
  • keep the action available and make user-message regeneration work consistently for Gemini too.

If maintainers can confirm the intended behavior, I can take a pass at the fix.

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @Minsklatte on GitHub (May 17, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/947 ## Summary In Roleplay mode, normal user-authored messages expose the Regenerate/Reroll action. After deleting the latest assistant message, using that action on the now-bottommost user message fails with Gemini, while the same flow appears to work with GPT-5.5. ## Expected behavior Either normal user-authored Roleplay messages should not show Regenerate/Reroll unless they have replay metadata, or regenerating them should work consistently across providers, including Gemini. ## Actual behavior With a Gemini model, clicking Regenerate/Reroll on a normal user message produces: > The AI returned an empty response. Try sending your message again. With GPT-5.5, the same flow appears to regenerate the user message successfully, so this may be a provider-specific prompt/payload-shaping issue rather than only a UI affordance issue. ## Steps to reproduce 1. Open a Roleplay chat. 2. Use a Gemini model. 3. Send a normal user message and receive an assistant response. 4. Delete the latest assistant response. 5. The latest/bottommost visible message is now the user message. 6. Click Regenerate/Reroll on that user message. ## Environment - Marinara Engine version: 1.6.0 - Install type: source - OS + version: Arch Linux Latest + Android Cinnamon Bun (17) - Browser or app shell: Browser + app shell ## Logs, screenshots, or video Error shown in the UI: > The AI returned an empty response. Try sending your message again. ## Additional context I retried the same flow with GPT-5.5 and it appeared to work, which makes me suspect this is related to provider-specific payload construction. My guess is that regeneration sends `regenerateMessageId` and excludes the target message from context. That works naturally for assistant-message swipes. But when the target is the latest user message, excluding it may leave the remaining prompt ending on a previous assistant/model turn. That may be tolerated by OpenAI/GPT-5.5, but Gemini’s native adapter maps assistant messages to `role: "model"` and user messages to `role: "user"`, so the Gemini request may end up without the expected latest user turn and return no visible text. Conversation mode appears to guard this case by allowing regenerate on user messages only when generation replay metadata exists. Roleplay may need the same guard, unless regenerating normal user messages is intended. I’d be happy to make a PR for this, but I’m not sure which behavior is intended: - hide Regenerate/Reroll on normal user-authored Roleplay messages, matching Conversation mode’s guard, or - keep the action available and make user-message regeneration work consistently for Gemini too. If maintainers can confirm the intended behavior, I can take a pass at the fix. ## Template check - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-20 17:29:06 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@SpicyMarinara commented on GitHub (May 17, 2026):

This is just a Gemini filter kicking in.

<!-- gh-comment-id:4471750280 --> @SpicyMarinara commented on GitHub (May 17, 2026): This is just a Gemini filter kicking in.
Author
Owner

@Minsklatte commented on GitHub (May 17, 2026):

Opened PR #954 with a Gemini-specific fix for user-message regenerate swipes: https://github.com/Pasta-Devs/Marinara-Engine/pull/954

<!-- gh-comment-id:4472327923 --> @Minsklatte commented on GitHub (May 17, 2026): Opened PR #954 with a Gemini-specific fix for user-message regenerate swipes: https://github.com/Pasta-Devs/Marinara-Engine/pull/954
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#460
No description provided.