[GH-ISSUE #1784] [Issue]: Gacha Forge companion chat fallback history includes pre-forged scenes not played yet #1755

Closed
opened 2026-11-07 16:36:27 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @SpicyMarinara on GitHub (Oct 27, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1784

Originally assigned to: @SpicyMarinara on GitHub.

Summary

When a companion chat (or a proactive message) falls back to the legacy story history, that history includes scenes the player has not played yet: pre-forged scenes of the current chapter and pre-forged next chapters. The companion can then know, and mention, story that has not happened.

Affected package

gacha-forge (1.25.1; still present in 1.25.2)

Expected behavior

A chat only knows canon the player has played (and what that character saw or was told), on the legacy fallback as on the memory path.

Actual behavior

  • The chat and proactive legacy history is built with _r(runId, Nr(runId) + 1, 0) (chat send and proactive message routes in server.mjs).
  • _r walks every chapter below that bound and reads any beat document that exists (nr reads the beat docs). Pre-forge writes beats ahead, so unplayed beats of the current chapter, and a pre-forged next chapter, are included.
  • The memory path is not affected: it uses played canon only. Only legacy() is, which runs when memory is not ready (an earlier chapter without a summary, an error, an unknown summary context).

Steps to reproduce

  1. Pre-forge on (Story). Play into a chapter while pre-forge writes the rest of it.
  2. While story memory is not ready (for example right after an update, or with no summary connection context configured), open a companion chat.
  3. The chat prompt's history contains the unplayed pre-forged scenes (visible in the debug prompt log).

Found by the critic in the #1777 investigation: at 400k context the base bundle sent unplayedBeat43=true, chapter44=true in a chat prompt.

Environment

  • Marinara Engine version: staging
  • Package version: gacha-forge 1.25.1
  • Install type: source
  • OS + version: macOS
  • Browser or app shell: n/a (server-side prompt)

Logs, screenshots, or video

Probe in the #1777 investigation (legacy-bound critic): chat legacy prompt includes the current chapter's unplayed beat 43 and pre-forged chapter 44.

Additional context

Suggested fix: with options.current, build the fallback from the frontier chapter and the played count (the progress the player has actually reached), not from Nr(runId) + 1 and "any beat document that exists". This is the knowledge boundary from 1.25.0: characters know only what they saw, took part in or were told.

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 (Oct 27, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1784 Originally assigned to: @SpicyMarinara on GitHub. ## Summary When a companion chat (or a proactive message) falls back to the legacy story history, that history includes scenes the player has not played yet: pre-forged scenes of the current chapter and pre-forged next chapters. The companion can then know, and mention, story that has not happened. ## Affected package `gacha-forge` (1.25.1; still present in 1.25.2) ## Expected behavior A chat only knows canon the player has played (and what that character saw or was told), on the legacy fallback as on the memory path. ## Actual behavior - The chat and proactive legacy history is built with `_r(runId, Nr(runId) + 1, 0)` (chat send and proactive message routes in `server.mjs`). - `_r` walks every chapter below that bound and reads any beat document that exists (`nr` reads the beat docs). Pre-forge writes beats ahead, so unplayed beats of the current chapter, and a pre-forged next chapter, are included. - The memory path is not affected: it uses played canon only. Only `legacy()` is, which runs when memory is not ready (an earlier chapter without a summary, an error, an unknown summary context). ## Steps to reproduce 1. Pre-forge on (Story). Play into a chapter while pre-forge writes the rest of it. 2. While story memory is not ready (for example right after an update, or with no summary connection context configured), open a companion chat. 3. The chat prompt's history contains the unplayed pre-forged scenes (visible in the debug prompt log). Found by the critic in the #1777 investigation: at 400k context the base bundle sent `unplayedBeat43=true, chapter44=true` in a chat prompt. ## Environment - Marinara Engine version: staging - Package version: gacha-forge 1.25.1 - Install type: source - OS + version: macOS - Browser or app shell: n/a (server-side prompt) ## Logs, screenshots, or video Probe in the #1777 investigation (legacy-bound critic): chat legacy prompt includes the current chapter's unplayed beat 43 and pre-forged chapter 44. ## Additional context Suggested fix: with `options.current`, build the fallback from the frontier chapter and the played count (the progress the player has actually reached), not from `Nr(runId) + 1` and "any beat document that exists". This is the knowledge boundary from 1.25.0: characters know only what they saw, took part in or were told. ## 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-11-07 16:36:27 +07:00
  • closed this issue
  • added the
    bug
    label
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-Agents#1755
No description provided.