[GH-ISSUE #1248] [Issue]: Refactor assistant regenerate loses generation replay metadata #611

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

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

Originally assigned to: @cha1latte on GitHub.

Summary

Assistant regeneration can lose or ignore the generation replay metadata needed to reproduce the original request shape. The generation path writes replay metadata to the user message, while the regenerate path reads replay metadata from the target assistant message.

Expected behavior

Regenerating an assistant message should reuse the replay metadata that produced the target response, including guided/impersonation/request-shape details, or should explicitly store that replay metadata on the assistant message/swipe target.

Actual behavior

The audit found replay metadata being built on the user message during generation, while the regenerate hook reads from the assistant message being regenerated. The assistant save path does not appear to persist that replay metadata in the same place the regenerate path reads it.

Steps to reproduce

  1. On the refactor branch, create a chat response with guided generation or another generation mode that depends on replay metadata.
  2. Regenerate the assistant message.
  3. Compare the regenerate request shape with the original request shape.
  4. Inspect the target assistant message metadata and swipes for the replay data the regenerate path expects.

Impact area

  • App shell, navigation, startup, or providers
  • Catalog resources
  • Chat mode
  • Roleplay mode
  • Game mode
  • Shared mode UI
  • Runtime systems: generation, world-state, visuals, tracker, or haptics
  • Professor Mari or shell tools
  • 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, identified during 2026-05-26 failpath audit
  • Run mode: Tauri desktop or web shell, generation path
  • OS + version: not OS-specific
  • Node + pnpm versions: not captured
  • Rust version, if relevant: not relevant
  • Remote Runtime URL configured? not relevant
  • Provider, model, or integration, if relevant: any text generation provider

Logs, screenshots, or video

Relevant code paths:

src/engine/generation/start-generation.ts
src/features/runtime/generation/hooks/use-generate.ts

Audit finding:

start-generation builds replay metadata on the user message.
use-generate reads replay metadata from the assistant message selected for regeneration.

Regression notes

Found by source inspection during the 2026-05-26 failpath audit. Needs a guided-regenerate regression test or focused manual trace.

Additional context

This can produce subtle behavior drift: the regenerated message may not use the same prompt/replay contract as the original target even though the UI action implies "regenerate this response."

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 @Xelvanis on GitHub (May 26, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1248 Originally assigned to: @cha1latte on GitHub. ## Summary Assistant regeneration can lose or ignore the generation replay metadata needed to reproduce the original request shape. The generation path writes replay metadata to the user message, while the regenerate path reads replay metadata from the target assistant message. ## Expected behavior Regenerating an assistant message should reuse the replay metadata that produced the target response, including guided/impersonation/request-shape details, or should explicitly store that replay metadata on the assistant message/swipe target. ## Actual behavior The audit found replay metadata being built on the user message during generation, while the regenerate hook reads from the assistant message being regenerated. The assistant save path does not appear to persist that replay metadata in the same place the regenerate path reads it. ## Steps to reproduce 1. On the `refactor` branch, create a chat response with guided generation or another generation mode that depends on replay metadata. 2. Regenerate the assistant message. 3. Compare the regenerate request shape with the original request shape. 4. Inspect the target assistant message metadata and swipes for the replay data the regenerate path expects. ## Impact area - [ ] App shell, navigation, startup, or providers - [ ] Catalog resources - [x] Chat mode - [x] Roleplay mode - [ ] Game mode - [ ] Shared mode UI - [x] Runtime systems: generation, world-state, visuals, tracker, or haptics - [ ] Professor Mari or shell tools - [x] React-free engine behavior, contracts, agents, or capability ports - [x] 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`, identified during 2026-05-26 failpath audit - Run mode: Tauri desktop or web shell, generation path - OS + version: not OS-specific - Node + pnpm versions: not captured - Rust version, if relevant: not relevant - Remote Runtime URL configured? not relevant - Provider, model, or integration, if relevant: any text generation provider ## Logs, screenshots, or video Relevant code paths: ```text src/engine/generation/start-generation.ts src/features/runtime/generation/hooks/use-generate.ts ``` Audit finding: ```text start-generation builds replay metadata on the user message. use-generate reads replay metadata from the assistant message selected for regeneration. ``` ## Regression notes Found by source inspection during the 2026-05-26 failpath audit. Needs a guided-regenerate regression test or focused manual trace. ## Additional context This can produce subtle behavior drift: the regenerated message may not use the same prompt/replay contract as the original target even though the UI action implies "regenerate this response." ## 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-20 17:30:42 +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#611
No description provided.