mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #6980] [MERGED] fix(chat): make a group reply go to the character being replied to #7416
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#7416
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/6980
Author: @SpicyMarinara
Created: 10/2/2026
Status: ✅ Merged
Merged: 10/2/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/reply-target-responds-first📝 Commits (3)
1399fc7fix(chat): make a group reply go to the character being replied to231245dfix(chat): find the replied-to message in the whole chatb0790bctest(chat): cover a reply in a Conversation merged group📊 Changes
3 files changed (+89 additions, -4 deletions)
View changed files
📝
CHANGELOG.md(+2 -0)📝
packages/server/src/routes/generate.routes.ts(+14 -2)📝
scripts/regressions/smart-group-decision.regression.ts(+73 -2)📄 Description
Linked issue
Closes #6978
Why this change
In a group chat, using Reply on a character's message almost always got an answer from a different character. The reply is stored on the user message (
extra.replyTo) and quoted into the responder's prompt, but choosing who speaks next never looked at it:getExplicitlyMentionedCharacterIds()only counts@Namementions andmentionedCharacterNames.conversationPromptHistoryContent) leaves the quote out, so neither can tell a reply happened.smart-group-decision.ts), the selector prompt says "Avoid making the same character speak twice in a row", and the fallback picks the first character who is not the last speaker. You usually reply to the message a character just sent, so the character being replied to is exactly the one all three avoid.What changed
generate.routes.ts: for the user's turn,getExplicitlyMentionedCharacterIds()now counts the author of the quoted message as addressed, like an@mention. That covers every path that already honours mentions: smart order (it answers without a Decision or selector call), explicit directives, and Conversation merged groups. A reply to the user's own message addresses no one. The quoted message is looked up in the whole chat (allChatMessages), so a reply to a message hidden from the AI or past the context message limit still finds its author; there is no name matching. Mentions found in a character's reply (the assistant-text path) are unchanged.scripts/regressions/smart-group-decision.regression.ts: real generate runs. Bram has just spoken and the Decision model favours Cole, yet replying to Bram's message makes Bram answer with no Decision or selector call. A reply to the user's own message still goes through smart order. A reply to an older Aya message past acontextMessageLimitof 2 makes Aya answer. Without the fix the first case fails (Cole answers); with a loaded-history-only lookup the last one fails (Cole instead of Aya).CHANGELOG.mdentry.Unavailable characters are still skipped, exactly as for an
@mention.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Run by the agent:
pnpm checkpasses.node ./scripts/run-regressions.mjs --filter scripts/regressions/smart-group-decision.regression.tspasses. With the new line removed it fails withactual: ['Cole'], expected: ['Bram'], and with the lookup limited to the loaded history it fails withactual: ['Cole'], expected: ['Aya'].231245d33.Still to verify by hand:
@mentionof that character does today.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)CHANGELOG updated; no user docs describe how responders are chosen for replies.
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.