[GH-ISSUE #2281] [Issue]: "Mark as new start" (isConversationStart) is ignored when assembling the generation prompt #1116

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

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

Originally assigned to: @Romuromylus on GitHub.

Summary

The "Mark as new start" control still toggles the isConversationStart flag, but the refactor's generation prompt assembly never scopes history to the latest marked message. Pre-marker messages keep leaking into the context window.

Expected behavior

Generation should scope chat history to the most recent isConversationStart message before applying hidden-from-AI filtering and the tail limit, so a restarted or forked scene starts clean, matching main.

Actual behavior

The marker has no effect on generation. History is loaded by limit/cursor only and tailed up to the 300-message cap, so older pre-marker messages still enter the prompt, causing stale scene bleed and wasted context.

Steps to reproduce

  1. In a long chat, use "Mark as new start" on a mid-conversation message to begin a fresh scene.
  2. Generate a reply.
  3. Observe the model still references content from before the marker (on main that content is excluded).

Impact area

  • Chat mode
  • Roleplay mode
  • React-free engine behavior, contracts, agents, or capability ports
  • Runtime systems: generation, world-state, visuals, tracker, or haptics

Regression notes

Worked on main. Every main generation entry point scans newest-to-oldest for the marker, slices from it, then filters/tails: packages/server/src/routes/generate.routes.ts:1960-1972, dry-run-route.ts:643-654,663-664, retry-agents-route.ts:2027-2035, chats.routes.ts:1441-1454. The refactor loads by limit/before-cursor only (src/engine/.../context.ts:75-82, src/engine/generation/start-generation.ts:962-1009,1097-1105) and historyMessages just filters hidden and slices the last N capped at 300 with no conversation-start cut (src/engine/generation/prompt-assembly.ts:2340-2353,2900-2907). isConversationStart is read only by a UI token estimate (GameNarration.tsx:224), the summary service (auto-summary.service.ts:168-173), and a Rust field allowlist (shared.rs:282), never in the generation path. The toggle still writes the flag (ChatMessage.tsx:2327, use-chat-timeline-actions.ts:574).

Environment

  • Branch or commit: refactor @ 5ddb9840 (compared against main @ b4ab97f)
  • Run mode: Tauri desktop
  • OS + version: Windows 11
  • Node + pnpm versions: not relevant (static source comparison)
  • Rust version, if relevant: not relevant (static source comparison)
  • Remote Runtime URL configured? not relevant
  • Provider, model, or integration, if relevant: see body

Template check

Please uncheck 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 @Romuromylus on GitHub (Jun 5, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2281 Originally assigned to: @Romuromylus on GitHub. ## Summary The "Mark as new start" control still toggles the isConversationStart flag, but the refactor's generation prompt assembly never scopes history to the latest marked message. Pre-marker messages keep leaking into the context window. ## Expected behavior Generation should scope chat history to the most recent isConversationStart message before applying hidden-from-AI filtering and the tail limit, so a restarted or forked scene starts clean, matching main. ## Actual behavior The marker has no effect on generation. History is loaded by limit/cursor only and tailed up to the 300-message cap, so older pre-marker messages still enter the prompt, causing stale scene bleed and wasted context. ## Steps to reproduce 1. In a long chat, use "Mark as new start" on a mid-conversation message to begin a fresh scene. 2. Generate a reply. 3. Observe the model still references content from before the marker (on main that content is excluded). ## Impact area - [x] Chat mode - [x] Roleplay mode - [x] React-free engine behavior, contracts, agents, or capability ports - [x] Runtime systems: generation, world-state, visuals, tracker, or haptics ## Regression notes Worked on main. Every main generation entry point scans newest-to-oldest for the marker, slices from it, then filters/tails: `packages/server/src/routes/generate.routes.ts:1960-1972`, `dry-run-route.ts:643-654,663-664`, `retry-agents-route.ts:2027-2035`, `chats.routes.ts:1441-1454`. The refactor loads by limit/before-cursor only (`src/engine/.../context.ts:75-82`, `src/engine/generation/start-generation.ts:962-1009,1097-1105`) and `historyMessages` just filters hidden and slices the last N capped at 300 with no conversation-start cut (`src/engine/generation/prompt-assembly.ts:2340-2353,2900-2907`). isConversationStart is read only by a UI token estimate (`GameNarration.tsx:224`), the summary service (`auto-summary.service.ts:168-173`), and a Rust field allowlist (`shared.rs:282`), never in the generation path. The toggle still writes the flag (`ChatMessage.tsx:2327`, `use-chat-timeline-actions.ts:574`). ## Environment - Branch or commit: refactor @ 5ddb9840 (compared against main @ b4ab97f) - Run mode: Tauri desktop - OS + version: Windows 11 - Node + pnpm versions: not relevant (static source comparison) - Rust version, if relevant: not relevant (static source comparison) - Remote Runtime URL configured? not relevant - Provider, model, or integration, if relevant: see body ## Template check Please uncheck 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:27:05 +07:00
Author
Owner

@Romuromylus commented on GitHub (Jun 6, 2026):

Fixed by #2392, merged into refactor.

<!-- gh-comment-id:4637944336 --> @Romuromylus commented on GitHub (Jun 6, 2026): Fixed by #2392, merged into `refactor`.
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#1116
No description provided.