mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #3046] [Issue]: In-turn group responses are appended without the speaker-name prefix, breaking 'Name Prefix History' for later responders in the same turn #1616
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#1616
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?
Originally created by @kolacheee on GitHub (Jun 29, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3046
Originally assigned to: @SpicyMarinara on GitHub.
What's wrong
With the "Name Prefix History" option on for a sequential, individual-mode group chat, prior committed history turns are correctly prefixed with
Name:so that individual-mode scoping (which collapses every non-target speaker into anonymousrole:"user"blocks) still lets the model tell who said what. But each character's freshly generated response in the SAME server turn is appended to the running context WITHOUT aName:prefix. The next responding character therefore sees this turn's earlier responses as anonymous, un-attributed user text — exactly the lines most relevant to its reply — defeating the feature for the in-turn responses.How to reproduce (try it yourself)
You'll see: Bob's prompt contains committed history with
Alice:/Bob:/ persona prefixes, but Alice's just-generated response (this turn) is merged into the user block with NOAlice:prefix, so Bob can't attribute the immediately-prior line.Expected: Alice's in-turn response carries the same
Alice:prefix the committed history uses.Where it is
packages/server/src/routes/generate.routes.ts:7263-7268— pushes the response intorunningMessagesas a bare assistant message (characterId set, noName:prefix).packages/server/src/routes/generate.routes.ts:6851-6856— explicitly STRIPS any leadingName:the model emitted, guaranteeing the fed-back line carries no marker.packages/server/src/services/generation/prompt-message-scope.ts:253-256— flips the non-target assistant history message torole:"user"without adding a prefix;mergeProviderAdjacentMessages(generate.routes.ts:6153-6180) then concatenates it with\n\n.generate.routes.ts:2078-2088; feature gating at1984-1989.What's happening
prefixGroupIndividualHistorySpeakersruns a single time on the committed history at iteration 0. The individual-mode loop appends each character's response as a raw, unprefixed assistant message and never re-applies the speaker prefix before that message is scoped/role-flipped/merged for subsequent characters — and the response's own leading name was already stripped — so the fed-back line is guaranteed to be unattributed.Suggested fix
Prefix each in-turn response with the speaker name before pushing it into
runningMessages, gated on the sameshouldPrefixGroupHistorySpeakersflag used for committed history. At generate.routes.ts:7263-7268:Reusing
prefixGroupIndividualHistorySpeakers(rather than the non-exportedprefixSpeakerName) shares the exact name-resolution map and idempotency guard already used for committed history. Regression notes: the change is gated to individual-mode, 2+ characters, non-conversation/game with the option on, so single-character/merged/conversation/game flows are untouched. The pushed message is prompt-only context for the next character — the saved/displayed message usesgenResult.responseindependently, so noName:leaks into stored or rendered text.prefixSpeakerNamechecks for an existing^Name:case-insensitively, so there is no double-prefix risk.v2.0.7 note:
generate.routes.tswas reworked inorigin/staging; this bug PERSISTS there — the in-turn response is still pushed unprefixed at staging lines ~7373-7378 (vs main 7263-7268), andprefixGroupIndividualHistorySpeakersis still applied only to committed history. Apply the prefix at that push.AI-investigated against v2.0.6; cited lines read and confirmed. Please verify before fixing.
@SpicyMarinara commented on GitHub (Jun 29, 2026):
Claiming this for the current staging sweep in draft PR #3053 (branch
codex/issue-sweep-3033-3052).@SpicyMarinara commented on GitHub (Jun 29, 2026):
Fixed in PR #3053 on branch
codex/issue-sweep-3033-3052(commitbfb1bc76). Closing this issue as addressed; the PR remains open for staging review/merge.