mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2957] [Issue]: Editing an assistant message in classic conversation view silently deletes its saved name/timestamp prefix #1533
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#1533
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 28, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2957
Originally assigned to: @SpicyMarinara on GitHub.
What's wrong
In classic conversation style, the edit box is pre-filled with the displayed version of an assistant message — which already has the leading
CharacterName:prefix (or a[12:30]timestamp) stripped out. If you make any real edit and save, that stripped text is written back to the database, permanently destroying the stored prefix/timestamp. You never see the prefix in the edit box, so there's no way to know you're dropping it.How to reproduce (try it yourself)
conversationMessageStyle === "classic") with an assistant message whose stored content starts with a name prefix — e.g.Aria:\nHello there.(common in group/individual mode), or a leading[12:30]timestamp. It displays as justHello there..Hello there.(the prefix is already gone, with no indication it existed).Hello!.You'll see: the stored content (and the active swipe row) becomes
Hello!— theAria:\nprefix (or[12:30]) is permanently gone from the DB.Expected: the edit box should seed with the raw stored content (prefix/timestamp intact) so an edit doesn't silently drop it.
(A pure no-op save does not corrupt — the change guard short-circuits. It requires an actual edit, which is the common case. The roleplay surface is not affected — it seeds the editor from raw
message.content.)Where it is
packages/client/src/components/chat/ConversationView.tsxbuilds the render item from the strip-applieddisplayMsg(lines 590-603) and doesn't carry the raw content onto the item. By render timemsgis already the stripped version, sooriginalContentat line 991 (displayMsg.content !== msg.content ? msg.content : undefined) isundefinedin the normal (non-regenerating) case. That flows intopackages/client/src/components/chat/ConversationMessage.tsx:editSourceContent = originalContent ?? message.content(426) →startEditingseeds the textarea from it (437) →handleSaveEditpersists it viaonEdit→updateMessageContent(overwritesmessages.contentand the active swipe row). ContrastChatMessage.tsx(roleplay), which seedsinitialContent={message.content}(1739) from raw content and is fine.What's happening
The raw DB content is discarded at the item-build layer — the item only carries the display-stripped
displayMsg— so the editor can only ever see stripped text, and there's no raw fallback foreditSourceContentto recover. Saving writes the stripped text verbatim. Anything that relied on the prefix (speaker attribution, export, branching) now has wrong content.Suggested fix
Carry the raw DB content onto the conversation item (e.g.
item.rawContent = msg.contentbefore stripping) and computeoriginalContentagainst the raw content, soeditSourceContentfalls back to raw. Alternatively pass a dedicatededitSourceprop holding the raw content, independent of the display transforms.AI-investigated against v2.0.6; both the item-build and render layers traced and confirmed. Please verify before fixing.
@SpicyMarinara commented on GitHub (Jun 29, 2026):
Fixed in staging: classic Conversation editing now keeps the raw stored message as the edit source even when the visible row strips timestamps/name prefixes for display. Validated with pnpm check and pnpm regression:prompt.