mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #7510] [MERGED] fix(agents): rewrite only the last group reply's own text #7767
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#7767
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/7510
Author: @SpicyMarinara
Created: 10/12/2026
Status: ✅ Merged
Merged: 10/12/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/group-rewrite-last-reply-only📝 Commits (2)
30199cafix(agents): rewrite only the last group reply's own text (#7509)ed52442fix(agents): build the rewrite agents' result summary once, before the part loop📊 Changes
2 files changed (+43 additions, -10 deletions)
View changed files
📝
packages/server/src/routes/generate.routes.ts(+9 -9)📝
scripts/regressions/advanced-memory-post-generation.regression.ts(+34 -1)📄 Description
Closes #7509
Why
Take a group chat where characters reply one by one, with Prose Guardian, Continuity or the HTML agent on. When several characters replied in one turn, the last character's message ended up holding every reply from that turn, rewritten together. The earlier characters' replies then showed twice: once in their own messages and again inside the last character's message. This happened with "hold for rewrite" on or off, whenever the last reply was not split at scene breaks. It is an older bug:
stagingbefore #7497 (3066f0c72) does the same.The cause: the rewrite step was given the whole turn (all replies joined) and saved the result into the last responder's message.
What changed
packages/server/src/routes/generate.routes.ts: when the last reply is not split, the rewrite agents now get that reply's own text, or the whole continued message for Continue, instead of the turn's joined replies. Single replies, merged groups and Game still have one reply per message, so they get the same text as before. The split case from #7507 is unchanged.scripts/regressions/advanced-memory-post-generation.regression.ts: new case with two individual responders and a last reply that is not split. It runs with hold on, hold off, and hold on with a failing rewrite. It checks that the rewrite agent sees only the last reply, that the earlier reply stays as written, and that thetext_rewriteevent (the rewrite, or the released held text) carries only the last reply. The fixture gained a smallmainReplyForhook so each responder answers with its own name. Without the fix, the case fails on currentstaging: the rewrite source isREPLY_FROM_Dottore.\n\nREPLY_FROM_Cyno.instead ofREPLY_FROM_Cyno.Validation
pnpm check: passed locally (exit 0)node ./scripts/run-regressions.mjs --filter advanced-memory: 16/16 passed locallynode ./scripts/run-regressions.mjs --filter roleplay: 14/14 passed locallynode ./scripts/run-regressions.mjs --filter regeneration-context: 2/2 passed locallycoderabbit review --agent --committed --base-commit <merge-base>): 1 minor finding, dismissed. It asked for this case in every chat mode and group mode. The changed line only matters when a turn produces several replies, which only happens in the shared individual-responder loop that Conversation and Roleplay both use. Merged groups, single replies and Game write one entry toallResponses, soallResponses.at(-1)is the same text as the old join.Manual verification needed
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.