[GH-ISSUE #2165] [Issue]: Secret Plot turn-only re-roll clobbers the overarching arc (secretPlotRerollMode ignored) #1074

Closed
opened 2026-10-21 05:26:22 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Romuromylus on GitHub (Jun 4, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2165

Originally assigned to: @cha1latte on GitHub.

Summary

The Secret Plot panel offers a "re-roll this turn only" button that is supposed to refresh per-turn guidance while preserving the long-running overarchingArc memory. In the refactor the secretPlotRerollMode flag is still sent by the UI but is read nowhere in the engine, and persistSecretPlotAgentMemory unconditionally overwrites overarchingArc on every secret-plot result, so a turn-only re-roll wipes the arc it was designed to keep.

Expected behavior

On a turn-only re-roll, the overarchingArc agent memory is preserved and only per-turn state (sceneDirections / pacing / staleDetected) is refreshed, matching legacy's secretPlotRerollMode !== "turn_only" guard before writing the arc.

Actual behavior

The engine ignores secretPlotRerollMode entirely (no match anywhere in src/engine or src-tauri; the only reference is the client SecretPlotPanel that sends it). persistSecretPlotAgentMemory always overwrites overarchingArc whenever the result carries one, so "turn_only" behaves identically to "full" and the arc is clobbered. The UI even shows a toast promising preservation, which is now false.

Steps to reproduce

  1. In a roleplay chat with Secret Plot active, build up an overarching arc over several turns.
  2. Click the Secret Plot panel's "re-roll this turn only" button.
  3. The long-running arc memory is overwritten instead of preserved.

Impact area

  • Roleplay mode
  • React-free engine behavior, contracts, agents, or capability ports

Environment

  • Branch or commit: refactor @ 93555d4b
  • Run mode: Tauri desktop
  • OS + version: Windows 11
  • Node + pnpm versions: n/a (static parity audit, main vs refactor)
  • Rust version, if relevant: n/a
  • Remote Runtime URL configured? not relevant

Regression notes

Worked in legacy (main @ c49f1d95). main: packages/server/src/routes/generate/retry-agents-route.ts:1574 gates the overarchingArc write on secretPlotRerollMode !== "turn_only". refactor @ 93555d4b: src/engine/generation/agent-memory-runtime.ts:44 (unconditional overarchingArc write); retry path at src/engine/generation/start-generation.ts:2392,2898; secretPlotRerollMode produced only at src/features/modes/roleplay/components/SecretPlotPanel.tsx:228, consumed nowhere. Fix: thread secretPlotRerollMode into persistSecretPlotAgentMemory and skip the arc write when it equals "turn_only".

Originally created by @Romuromylus on GitHub (Jun 4, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2165 Originally assigned to: @cha1latte on GitHub. ## Summary The Secret Plot panel offers a "re-roll this turn only" button that is supposed to refresh per-turn guidance while preserving the long-running `overarchingArc` memory. In the refactor the `secretPlotRerollMode` flag is still sent by the UI but is read nowhere in the engine, and `persistSecretPlotAgentMemory` unconditionally overwrites `overarchingArc` on every secret-plot result, so a turn-only re-roll wipes the arc it was designed to keep. ## Expected behavior On a turn-only re-roll, the `overarchingArc` agent memory is preserved and only per-turn state (sceneDirections / pacing / staleDetected) is refreshed, matching legacy's `secretPlotRerollMode !== "turn_only"` guard before writing the arc. ## Actual behavior The engine ignores `secretPlotRerollMode` entirely (no match anywhere in `src/engine` or `src-tauri`; the only reference is the client `SecretPlotPanel` that sends it). `persistSecretPlotAgentMemory` always overwrites `overarchingArc` whenever the result carries one, so "turn_only" behaves identically to "full" and the arc is clobbered. The UI even shows a toast promising preservation, which is now false. ## Steps to reproduce 1. In a roleplay chat with Secret Plot active, build up an overarching arc over several turns. 2. Click the Secret Plot panel's "re-roll this turn only" button. 3. The long-running arc memory is overwritten instead of preserved. ## Impact area - [x] Roleplay mode - [x] React-free engine behavior, contracts, agents, or capability ports ## Environment - Branch or commit: refactor @ 93555d4b - Run mode: Tauri desktop - OS + version: Windows 11 - Node + pnpm versions: n/a (static parity audit, main vs refactor) - Rust version, if relevant: n/a - Remote Runtime URL configured? not relevant ## Regression notes Worked in legacy (main @ c49f1d95). main: `packages/server/src/routes/generate/retry-agents-route.ts:1574` gates the overarchingArc write on `secretPlotRerollMode !== "turn_only"`. refactor @ 93555d4b: `src/engine/generation/agent-memory-runtime.ts:44` (unconditional overarchingArc write); retry path at `src/engine/generation/start-generation.ts:2392,2898`; `secretPlotRerollMode` produced only at `src/features/modes/roleplay/components/SecretPlotPanel.tsx:228`, consumed nowhere. Fix: thread `secretPlotRerollMode` into `persistSecretPlotAgentMemory` and skip the arc write when it equals "turn_only".
bsakaguchi 2026-10-21 05:26:22 +07:00
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#1074
No description provided.