[GH-ISSUE #5349] [Issue]: Game Mode JSONL export preserves deleted and edited narration segments #2958

Closed
opened 2026-10-21 05:58:21 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @SpicyMarinara on GitHub (Aug 21, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5349

Originally assigned to: @SpicyMarinara on GitHub.

Summary

Deleting or editing narration segments in Game Mode changes the visible transcript but is not applied to exported JSONL content. Reimporting the export can restore deleted text and lose segment changes.

Expected behavior

The JSONL export should match the transcript currently displayed in Game Mode: deleted segments should be absent, edited segments should contain their edited text, and importing the export should preserve those changes.

Actual behavior

The exported JSONL retains the original text in the message's mes and swipes fields. Reimporting the file restores deleted material. Segment changes are stored as metadata overlays, but the exporter does not apply them and imported messages receive new IDs that no longer match the original metadata.

Steps to reproduce

  1. Start a Game Mode chat.
  2. Generate a response containing several narration or dialogue segments.
  3. Delete one segment using its delete control, or edit a segment.
  4. Confirm that the change is reflected in the Game Mode interface.
  5. Export the chat as JSONL.
  6. Search the JSONL for the deleted text or import the file as a new chat.
  7. Observe that deleted text or the original segment content is still present.

Environment

  • Marinara Engine version: v2.4.3
  • Install type: Not provided
  • OS + version: Not provided
  • Browser or app shell: Not provided

Logs, screenshots, or video

No logs, screenshots, or video were provided.

Additional context

The issue appears related to metadata overlays such as segmentDelete::. The exporter writes original message content without applying these overlays, and exported message entries do not retain their original message IDs. Impact includes restored deleted story content, exports that differ from the visible transcript, and segment-edit metadata that increases export size without reliably preserving edits. A possible fix is to apply segment edits and deletions to a copy before export, or preserve and remap original message IDs during import.

Discord thread: Game Mode JSONL session export does not preserve deleted or edited narration segments
Discord thread link: https://discord.com/channels/1417099416812392641/1540184626914398248
Requested by: Marinara (marinara_spaghetti, Discord ID 169561011928432653)

Discord thread transcript (2 messages)
[2026-08-21T02:23:50.303Z] Grimm: Hi, this is a little difficult to report so I had to use GPT to articulate this. I'm just sending a dump of GPT for this. Hope this is fine.

Marinara Version: Release: v2.4.3

Deleting an individual narration segment in Game Mode hides it in the interface, but the deleted text remains in the exported JSONL. If that JSONL is imported again, the deleted text returns.

Steps to reproduce:

Start a Game Mode chat.
Generate a response containing several narration or dialogue segments.
Delete one segment using its delete control.
Confirm that the segment disappears from Game Mode.
Export the chat as JSONL.
Search the JSONL for the deleted text, or import the file as a new chat.

Expected result:

The export should match the transcript currently displayed in Game Mode. Deleted segments should be absent, edited segments should contain their edited text, and importing the export should preserve those changes.

Actual result:

The JSONL still contains the original text in the message’s mes and swipes fields. Reimporting the file restores the deleted material.

This appears to happen because Game Mode stores segment changes as metadata overlays such as:

segmentDelete:<messageId>:<segmentIndex>

The exporter writes the original message content without applying those overlays. Exported message entries also do not retain their original message IDs. During import, messages receive new IDs, so the old segment-deletion metadata can no longer identify the correct messages.
[Discord message: https://discord.com/channels/1417099416812392641/1540184626914398248/1540184626914398248]

[2026-08-21T02:24:05.790Z] Grimm: Hit the limit. But there's this additional stuff that I got from GPT that might help?

Impact:

Deleted story content unexpectedly returns after export and import.
Incorrect or retconned information can be restored and shown to the model.
Exported transcripts do not match what the user sees.
Segment-edit metadata adds substantial size to the export without reliably preserving the edits.

Suggested fix:

Before exporting, apply all segment edits and deletions to a copy of the message text and export the resulting visible content. Alternatively, preserve and remap original message IDs during import so the segment metadata still works.

No private session is required to reproduce this. A disposable chat containing simple test lines such as “Segment one,” “Segment two,” and “Segment three” should demonstrate the issue.
[Discord message: https://discord.com/channels/1417099416812392641/1540184626914398248/1540184691871842324]

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @SpicyMarinara on GitHub (Aug 21, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5349 Originally assigned to: @SpicyMarinara on GitHub. ## Summary Deleting or editing narration segments in Game Mode changes the visible transcript but is not applied to exported JSONL content. Reimporting the export can restore deleted text and lose segment changes. ## Expected behavior The JSONL export should match the transcript currently displayed in Game Mode: deleted segments should be absent, edited segments should contain their edited text, and importing the export should preserve those changes. ## Actual behavior The exported JSONL retains the original text in the message's mes and swipes fields. Reimporting the file restores deleted material. Segment changes are stored as metadata overlays, but the exporter does not apply them and imported messages receive new IDs that no longer match the original metadata. ## Steps to reproduce 1. Start a Game Mode chat. 2. Generate a response containing several narration or dialogue segments. 3. Delete one segment using its delete control, or edit a segment. 4. Confirm that the change is reflected in the Game Mode interface. 5. Export the chat as JSONL. 6. Search the JSONL for the deleted text or import the file as a new chat. 7. Observe that deleted text or the original segment content is still present. ## Environment - Marinara Engine version: v2.4.3 - Install type: Not provided - OS + version: Not provided - Browser or app shell: Not provided ## Logs, screenshots, or video No logs, screenshots, or video were provided. ## Additional context The issue appears related to metadata overlays such as segmentDelete:<messageId>:<segmentIndex>. The exporter writes original message content without applying these overlays, and exported message entries do not retain their original message IDs. Impact includes restored deleted story content, exports that differ from the visible transcript, and segment-edit metadata that increases export size without reliably preserving edits. A possible fix is to apply segment edits and deletions to a copy before export, or preserve and remap original message IDs during import. Discord thread: Game Mode JSONL session export does not preserve deleted or edited narration segments Discord thread link: https://discord.com/channels/1417099416812392641/1540184626914398248 Requested by: Marinara (marinara_spaghetti, Discord ID 169561011928432653) <details> <summary>Discord thread transcript (2 messages)</summary> ```text [2026-08-21T02:23:50.303Z] Grimm: Hi, this is a little difficult to report so I had to use GPT to articulate this. I'm just sending a dump of GPT for this. Hope this is fine. Marinara Version: Release: v2.4.3 Deleting an individual narration segment in Game Mode hides it in the interface, but the deleted text remains in the exported JSONL. If that JSONL is imported again, the deleted text returns. Steps to reproduce: Start a Game Mode chat. Generate a response containing several narration or dialogue segments. Delete one segment using its delete control. Confirm that the segment disappears from Game Mode. Export the chat as JSONL. Search the JSONL for the deleted text, or import the file as a new chat. Expected result: The export should match the transcript currently displayed in Game Mode. Deleted segments should be absent, edited segments should contain their edited text, and importing the export should preserve those changes. Actual result: The JSONL still contains the original text in the message’s mes and swipes fields. Reimporting the file restores the deleted material. This appears to happen because Game Mode stores segment changes as metadata overlays such as: segmentDelete:<messageId>:<segmentIndex> The exporter writes the original message content without applying those overlays. Exported message entries also do not retain their original message IDs. During import, messages receive new IDs, so the old segment-deletion metadata can no longer identify the correct messages. [Discord message: https://discord.com/channels/1417099416812392641/1540184626914398248/1540184626914398248] [2026-08-21T02:24:05.790Z] Grimm: Hit the limit. But there's this additional stuff that I got from GPT that might help? Impact: Deleted story content unexpectedly returns after export and import. Incorrect or retconned information can be restored and shown to the model. Exported transcripts do not match what the user sees. Segment-edit metadata adds substantial size to the export without reliably preserving the edits. Suggested fix: Before exporting, apply all segment edits and deletions to a copy of the message text and export the resulting visible content. Alternatively, preserve and remap original message IDs during import so the segment metadata still works. No private session is required to reproduce this. A disposable chat containing simple test lines such as “Segment one,” “Segment two,” and “Segment three” should demonstrate the issue. [Discord message: https://discord.com/channels/1417099416812392641/1540184626914398248/1540184691871842324] ``` </details> ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 05:58:21 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (Aug 21, 2026):

Resolved in #5350 and landed on staging.

<!-- gh-comment-id:5366685853 --> @SpicyMarinara commented on GitHub (Aug 21, 2026): Resolved in #5350 and landed on `staging`.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#2958
No description provided.