[GH-ISSUE #2450] 12-PROMPT-RUNTIME-regenerate-continue-impersonate: user-message regeneration source prompt is missing #1205

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

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

Originally assigned to: @Xelvanis on GitHub.

Summary

12-PROMPT-RUNTIME-regenerate-continue-impersonate: refactor regeneration does not preserve the legacy user-message regeneration prompt path. Assistant regenerate, continue, and impersonate paths have matching static evidence, but the legacy path for regenerating a user message keeps the source user turn available for prompt macros/lorebook/memory and builds a rewrite prompt; no equivalent refactor path was found.

Links: #2442

Expected behavior

Regenerating a user message should preserve legacy prompt semantics:

  • Exclude the target user message from saved chat history context.
  • Still use the original user turn as prompt source text for macros, lorebook matching, semantic embeddings, memory recall, and rewrite instruction construction.
  • Save the regenerated user message/swipe without adding duplicate visible user turns.

Actual behavior

Refactor slices history before the regenerate target and saves regenerated content as a swipe, but targeted static trace did not find a user-message source/rewrite prompt path equivalent to legacy buildUserMessageRegenerationPromptFromSource.

Steps to reproduce

  1. In a chat with a visible user message, request regeneration of that user message.
  2. Compare prompt assembly against legacy behavior for source user text, macros, lorebook/memory input, and rewrite instruction.
  3. Observe that refactor has no confirmed equivalent user-message regeneration source/rewrite path.

Impact area

  • Chat mode
  • Roleplay mode
  • Game mode
  • Shared mode UI
  • Runtime systems: generation, world-state, visuals, tracker, or haptics
  • React-free engine behavior, contracts, agents, or capability ports
  • Shared API wrapper or remote runtime routing
  • Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime
  • Docs, contributor workflow, or templates

Environment

  • Branch or commit: refactor
  • Run mode: not run; static parity trace only
  • OS + version: not relevant
  • Node + pnpm versions: not run
  • Rust version, if relevant: not relevant
  • Remote Runtime URL configured? not relevant
  • Provider, model, or integration, if relevant: provider-neutral prompt assembly

Logs, screenshots, or video

Proof:

  • Legacy replays stored generation context and target speaker: main:packages/server/src/routes/generate.routes.ts:1764.
  • Legacy user-message regeneration excludes the target from real history but keeps source text for prompt shaping: main:packages/server/src/routes/generate.routes.ts:1978, main:packages/server/src/routes/generate.routes.ts:2108, main:packages/server/src/routes/generate.routes.ts:2367.
  • Refactor applies stored replay and slices history before the regenerate target: src/engine/generation/start-generation.ts:1150, src/engine/generation/start-generation.ts:1320, src/engine/generation/start-generation.ts:3050.
  • Refactor saves regenerated content as a swipe, but targeted search found no user-message regeneration source/rewrite helper: src/engine/generation/start-generation.ts:2384.

Files inspected:

  • src/engine/generation/start-generation.ts
  • src/engine/generation/generation-replay.ts
  • src/engine/generation/prompt-assembly.ts
  • src/engine/shared/text/generation-guide.ts
  • src/engine/modes/chat/commands/impersonate-prompt.ts
  • main:packages/server/src/routes/generate.routes.ts
  • main:packages/server/src/services/conversation/impersonate-prompt.ts
  • main:packages/shared/src/utils/generation-guide.ts

Regression notes

Legacy main has explicit user-message regeneration source/rewrite handling in packages/server/src/routes/generate.routes.ts. The refactor static trace did not find the equivalent path.

Additional context

Acceptance criteria:

  • User-message regeneration in refactor keeps the target user turn available for prompt-only source behavior without duplicating visible user turns.
  • Prompt macros, lorebook activation, semantic/memory input, and rewrite instruction behavior match legacy for user-message regeneration.
  • Existing assistant regenerate, continue, impersonate, and group-turn behavior remains unchanged.
  • Add focused proof or tests for assistant-message regenerate vs user-message regenerate so the two paths do not collapse together.

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 @Promansis on GitHub (Jun 6, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2450 Originally assigned to: @Xelvanis on GitHub. ## Summary `12-PROMPT-RUNTIME-regenerate-continue-impersonate`: refactor regeneration does not preserve the legacy user-message regeneration prompt path. Assistant regenerate, continue, and impersonate paths have matching static evidence, but the legacy path for regenerating a user message keeps the source user turn available for prompt macros/lorebook/memory and builds a rewrite prompt; no equivalent refactor path was found. Links: #2442 ## Expected behavior Regenerating a user message should preserve legacy prompt semantics: - Exclude the target user message from saved chat history context. - Still use the original user turn as prompt source text for macros, lorebook matching, semantic embeddings, memory recall, and rewrite instruction construction. - Save the regenerated user message/swipe without adding duplicate visible user turns. ## Actual behavior Refactor slices history before the regenerate target and saves regenerated content as a swipe, but targeted static trace did not find a user-message source/rewrite prompt path equivalent to legacy `buildUserMessageRegenerationPromptFromSource`. ## Steps to reproduce 1. In a chat with a visible user message, request regeneration of that user message. 2. Compare prompt assembly against legacy behavior for source user text, macros, lorebook/memory input, and rewrite instruction. 3. Observe that refactor has no confirmed equivalent user-message regeneration source/rewrite path. ## Impact area - [x] Chat mode - [x] Roleplay mode - [ ] Game mode - [ ] Shared mode UI - [x] Runtime systems: generation, world-state, visuals, tracker, or haptics - [x] React-free engine behavior, contracts, agents, or capability ports - [ ] Shared API wrapper or remote runtime routing - [ ] Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime - [ ] Docs, contributor workflow, or templates ## Environment - Branch or commit: refactor - Run mode: not run; static parity trace only - OS + version: not relevant - Node + pnpm versions: not run - Rust version, if relevant: not relevant - Remote Runtime URL configured? not relevant - Provider, model, or integration, if relevant: provider-neutral prompt assembly ## Logs, screenshots, or video Proof: - Legacy replays stored generation context and target speaker: `main:packages/server/src/routes/generate.routes.ts:1764`. - Legacy user-message regeneration excludes the target from real history but keeps source text for prompt shaping: `main:packages/server/src/routes/generate.routes.ts:1978`, `main:packages/server/src/routes/generate.routes.ts:2108`, `main:packages/server/src/routes/generate.routes.ts:2367`. - Refactor applies stored replay and slices history before the regenerate target: `src/engine/generation/start-generation.ts:1150`, `src/engine/generation/start-generation.ts:1320`, `src/engine/generation/start-generation.ts:3050`. - Refactor saves regenerated content as a swipe, but targeted search found no user-message regeneration source/rewrite helper: `src/engine/generation/start-generation.ts:2384`. Files inspected: - `src/engine/generation/start-generation.ts` - `src/engine/generation/generation-replay.ts` - `src/engine/generation/prompt-assembly.ts` - `src/engine/shared/text/generation-guide.ts` - `src/engine/modes/chat/commands/impersonate-prompt.ts` - `main:packages/server/src/routes/generate.routes.ts` - `main:packages/server/src/services/conversation/impersonate-prompt.ts` - `main:packages/shared/src/utils/generation-guide.ts` ## Regression notes Legacy `main` has explicit user-message regeneration source/rewrite handling in `packages/server/src/routes/generate.routes.ts`. The refactor static trace did not find the equivalent path. ## Additional context Acceptance criteria: - User-message regeneration in refactor keeps the target user turn available for prompt-only source behavior without duplicating visible user turns. - Prompt macros, lorebook activation, semantic/memory input, and rewrite instruction behavior match legacy for user-message regeneration. - Existing assistant regenerate, continue, impersonate, and group-turn behavior remains unchanged. - Add focused proof or tests for assistant-message regenerate vs user-message regenerate so the two paths do not collapse together. ## 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.
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#1205
No description provided.