[GH-ISSUE #1037] [Issue]: Consistency Editor JSON repair corrupts narration with ellipses #509

Closed
opened 2026-10-20 17:29:37 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @cha1latte on GitHub (May 20, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1037

Originally assigned to: @cha1latte on GitHub.

Summary

The Consistency Editor can corrupt otherwise valid JSON when narration contains ellipses such as "It's... it's very warm,".

Source Discord thread: https://discord.com/channels/1417099416812392641/1480379733173731458/threads/1506417676350918826

Reporter: Azem Kitsune

Expected behavior

The Consistency Editor should preserve valid JSON and should not remove narration content that contains ellipses.

Actual behavior

The reporter says repairJson includes a replacement that removes ellipsis-like text:

.replace(/\.\.\.[^"\n]*/g, "");

When narration contains ellipses, that replacement can alter the content and corrupt JSON that was originally valid.

Steps to reproduce

  1. Run the Consistency Editor agent in RP.
  2. Include narration with ellipses, for example "It's... it's very warm,".
  3. Let the Consistency Editor process the message.
  4. Observe that JSON can be corrupted by the repair function.

Marinara Engine version

1.6.0 and prior

Install type

Docker

OS + version

Windows 11 with Docker Desktop

Browser or app shell

Not specified.

Screenshots or video

Not a visual/UI issue.

Logs

Relevant snippet from the report:

function repairJson(str: string): string {
  return str
    .replace(/\/\/[^\n]*/g, "")
    .replace(/\/\*[\s\S]*?\*\//g, "")
    .replace(/,\s*([\]\}])/g, "$1");
    .replace(/\.\.\.[^"\n]*/g, "");
}

Additional context

The reporter locally patched their container to first try parsing the JSON as-is, then only apply more conservative repairs if initial parsing fails.

Template check

  • I provided the required summary, behavior, reproduction, and environment details.
  • If this is a visual/UI bug, blank screen, layout issue, mobile/responsive issue, incorrect image or sprite, broken animation, or unexpected error state, I attached screenshots or video.
Originally created by @cha1latte on GitHub (May 20, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1037 Originally assigned to: @cha1latte on GitHub. ## Summary The Consistency Editor can corrupt otherwise valid JSON when narration contains ellipses such as `"It's... it's very warm,"`. Source Discord thread: https://discord.com/channels/1417099416812392641/1480379733173731458/threads/1506417676350918826 Reporter: Azem Kitsune ## Expected behavior The Consistency Editor should preserve valid JSON and should not remove narration content that contains ellipses. ## Actual behavior The reporter says `repairJson` includes a replacement that removes ellipsis-like text: ```ts .replace(/\.\.\.[^"\n]*/g, ""); ``` When narration contains ellipses, that replacement can alter the content and corrupt JSON that was originally valid. ## Steps to reproduce 1. Run the Consistency Editor agent in RP. 2. Include narration with ellipses, for example `"It's... it's very warm,"`. 3. Let the Consistency Editor process the message. 4. Observe that JSON can be corrupted by the repair function. ## Marinara Engine version 1.6.0 and prior ## Install type Docker ## OS + version Windows 11 with Docker Desktop ## Browser or app shell Not specified. ## Screenshots or video Not a visual/UI issue. ## Logs Relevant snippet from the report: ```ts function repairJson(str: string): string { return str .replace(/\/\/[^\n]*/g, "") .replace(/\/\*[\s\S]*?\*\//g, "") .replace(/,\s*([\]\}])/g, "$1"); .replace(/\.\.\.[^"\n]*/g, ""); } ``` ## Additional context The reporter locally patched their container to first try parsing the JSON as-is, then only apply more conservative repairs if initial parsing fails. ## Template check - [ ] I provided the required summary, behavior, reproduction, and environment details. - [ ] If this is a visual/UI bug, blank screen, layout issue, mobile/responsive issue, incorrect image or sprite, broken animation, or unexpected error state, I attached screenshots or video.
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#509
No description provided.