mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #954] [MERGED] Fix Gemini user-message regeneration swipes #4858
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#4858
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/954
Author: @Minsklatte
Created: 5/17/2026
Status: ✅ Merged
Merged: 5/20/2026
Merged by: @cha1latte
Base:
staging← Head:codex/fix-gemini-user-regenerate📝 Commits (10+)
ae8d81dFix Gemini user-message regeneration swipes09e0546Preserve prefill for Gemini user regeneration06b2dcbDocument user regeneration helperfdc715fPreserve attachments for user regeneration19bb332Preserve user regen context for prompt shaping9f70553test: cover transformed user regen prompt sourcebe8b215fix: rebuild user regen prompt after regex transforms51c51cfMerge branch 'staging' into codex/fix-gemini-user-regenerate92b7375fix: ignore malformed regeneration attachments1fdfa1cfix: block hidden user message regeneration📊 Changes
4 files changed (+562 additions, -13 deletions)
View changed files
📝
packages/server/src/routes/generate.routes.ts(+66 -12)📝
packages/server/src/routes/generate/generate-route-utils.ts(+118 -1)➕
tests/user-message-regeneration-hidden-from-ai.test.ts(+46 -0)➕
tests/user-message-regeneration-instruction.test.ts(+332 -0)📄 Description
Linked issue
Fixes #947.
Why this change
Roleplay user-message regeneration is intended to create an alternate swipe on the clicked user-authored message.
The existing regenerate path excludes the target message from context before generation. For a bottommost user-message regenerate, that can leave Gemini's native request ending on the previous assistant/model turn. I reproduced Gemini returning HTTP 200 with
finishReason: STOPand empty text for that shape, while an explicit final user-role rewrite instruction returns replacement text.This PR keeps the existing swipe behavior, but fixes the Gemini-specific empty-response path without changing OpenAI or other providers' prompt construction.
What changed
Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
packages/server/node_modules/.bin/tsx --test tests/user-message-regeneration-instruction.test.ts; result: 6 tests passed, 0 failed.pnpm --filter @marinara-engine/server build; result: passed.pnpm build; result: passed.pnpm lint; result: passed.pnpm check; result: blocked before lint/build atimpeccable:checkwithImpeccable context loader did not return valid JSON, so thepnpm checkvalidation box is intentionally left unchecked.describe this imageplus an image attachment, regenerated that user message, and the regenerated swipe correctly described the image.Docs and release impact
UI evidence (if applicable)
No UI changes.
Summary by CodeRabbit
New Features
Tests
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.