[PR #822] [MERGED] Fix regenerate replay for command prompts #4791

Closed
opened 2026-10-22 04:10:41 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/822
Author: @Xelvanis
Created: 5/14/2026
Status: ✅ Merged
Merged: 5/14/2026
Merged by: @Xelvanis

Base: main ← Head: fix/regenerate-command-prompts


📝 Commits (3)

  • 1fad806 Add generation replay for consistent swipe/regen
  • 0e8f66c Show stored generation guidance on swipes
  • 8eb63fa Address generation replay review feedback

📊 Changes

14 files changed (+566 additions, -18 deletions)

View changed files

📝 packages/client/src/components/chat/ChatArea.tsx (+8 -4)
📝 packages/client/src/components/chat/ChatInput.tsx (+2 -2)
📝 packages/client/src/components/chat/ChatMessage.tsx (+37 -0)
📝 packages/client/src/components/chat/ConversationInput.tsx (+2 -2)
📝 packages/client/src/components/chat/ConversationMessage.tsx (+45 -5)
➕ packages/client/src/components/chat/GenerationReplayDetailsModal.tsx (+119 -0)
📝 packages/client/src/lib/slash-commands.ts (+6 -5)
📝 packages/server/src/routes/generate.routes.ts (+14 -0)
➕ packages/server/src/routes/generate/generation-replay.ts (+147 -0)
📝 packages/server/src/services/storage/chats.storage.ts (+1 -0)
➕ packages/server/test/generation-replay.test.ts (+154 -0)
📝 packages/shared/src/index.ts (+1 -0)
📝 packages/shared/src/types/chat.ts (+16 -0)
➕ packages/shared/src/utils/generation-guide.ts (+14 -0)

📄 Description

Linked issue

Closes #820

Why this change

  • Regenerate/swipe requests only send the target message id, so slash-command prompt details from /narrator and /impersonate were lost on the next swipe.
  • Guided regenerates also needed clearer replay behavior so users can tell which guidance is stored on each message/swipe.

What changed

  • Stores generation replay metadata on generated messages/swipes for /narrator, guided regenerate, game-start guidance, and /impersonate.
  • Applies stored replay metadata server-side when regenerating a message, while preserving fresh guidance typed into the chat input.
  • Adds a Stored guidance action to chat/conversation messages so users can inspect the guidance attached to the active swipe.
  • Shares narrator/guided guidance template helpers across client and server to keep displayed/stored behavior aligned.
  • Clears stale replay metadata when opening a fresh swipe before the completed generation writes the new metadata.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

  • Ran pnpm --filter @marinara-engine/shared build.
  • Ran pnpm exec tsx --import ./test/setup-env.ts --test test/generation-replay.test.ts from the server package.
  • Ran pnpm check; it passed with the existing Node DEP0190 build warning.
  • Codex Chromium pass covered /narrator, empty-input regenerate replay, guided regenerate override, cleared-input replay from a guided swipe, /impersonate, and guided impersonate regenerate against a local mock provider.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Version/release files updated (only if this PR includes a version bump)

No version or release files changed. A follow-up docs note may be useful to explain stored replay/guidance semantics to users.

UI evidence (if applicable)

Stored guidance modal was checked in the Chromium pass, but no screenshots are attached yet.

Summary by CodeRabbit

  • New Features

    • View "Stored guidance" details for messages via a new modal.
    • Regenerations now persist and reapply stored generation guidance and impersonation settings for more reliable reproductions.
    • Shared generation-guide utilities and types added to public API.
  • Tests

    • Added test coverage for generation-replay behavior across regenerate scenarios.

Review Change Stack


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/822 **Author:** [@Xelvanis](https://github.com/Xelvanis) **Created:** 5/14/2026 **Status:** ✅ Merged **Merged:** 5/14/2026 **Merged by:** [@Xelvanis](https://github.com/Xelvanis) **Base:** `main` ← **Head:** `fix/regenerate-command-prompts` --- ### 📝 Commits (3) - [`1fad806`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1fad806bc4fd9f21a00e2aabcaeaf5529c20690f) Add generation replay for consistent swipe/regen - [`0e8f66c`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0e8f66c613d65bcea09ab10fb0cf781181c1adf0) Show stored generation guidance on swipes - [`8eb63fa`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8eb63fae9d53f6b7c4cfbbb2e51c00bb8bf2741b) Address generation replay review feedback ### 📊 Changes **14 files changed** (+566 additions, -18 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/chat/ChatArea.tsx` (+8 -4) 📝 `packages/client/src/components/chat/ChatInput.tsx` (+2 -2) 📝 `packages/client/src/components/chat/ChatMessage.tsx` (+37 -0) 📝 `packages/client/src/components/chat/ConversationInput.tsx` (+2 -2) 📝 `packages/client/src/components/chat/ConversationMessage.tsx` (+45 -5) ➕ `packages/client/src/components/chat/GenerationReplayDetailsModal.tsx` (+119 -0) 📝 `packages/client/src/lib/slash-commands.ts` (+6 -5) 📝 `packages/server/src/routes/generate.routes.ts` (+14 -0) ➕ `packages/server/src/routes/generate/generation-replay.ts` (+147 -0) 📝 `packages/server/src/services/storage/chats.storage.ts` (+1 -0) ➕ `packages/server/test/generation-replay.test.ts` (+154 -0) 📝 `packages/shared/src/index.ts` (+1 -0) 📝 `packages/shared/src/types/chat.ts` (+16 -0) ➕ `packages/shared/src/utils/generation-guide.ts` (+14 -0) </details> ### 📄 Description ## Linked issue Closes #820 ## Why this change - Regenerate/swipe requests only send the target message id, so slash-command prompt details from `/narrator` and `/impersonate` were lost on the next swipe. - Guided regenerates also needed clearer replay behavior so users can tell which guidance is stored on each message/swipe. ## What changed - Stores generation replay metadata on generated messages/swipes for `/narrator`, guided regenerate, game-start guidance, and `/impersonate`. - Applies stored replay metadata server-side when regenerating a message, while preserving fresh guidance typed into the chat input. - Adds a Stored guidance action to chat/conversation messages so users can inspect the guidance attached to the active swipe. - Shares narrator/guided guidance template helpers across client and server to keep displayed/stored behavior aligned. - Clears stale replay metadata when opening a fresh swipe before the completed generation writes the new metadata. ## Validation <!-- Required: include commands run and/or manual checks performed --> - [x] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [x] Ran the app, clicked through the changes manually - [x] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [x] Above manual verification completed (describe below) - [x] Read and followed `CONTRIBUTING.md` ### Manual verification notes <!-- Describe exactly what you tested in a real browser/app, step by step. --> <!-- ⚠️ If an AI agent filled out or ticked these boxes for you, treat them --> <!-- as a TO-DO LIST, not as proof the work is done. Verify each item yourself --> <!-- before submitting. If you haven't verified it, untick the box. --> - Ran `pnpm --filter @marinara-engine/shared build`. - Ran `pnpm exec tsx --import ./test/setup-env.ts --test test/generation-replay.test.ts` from the server package. - Ran `pnpm check`; it passed with the existing Node DEP0190 build warning. - Codex Chromium pass covered `/narrator`, empty-input regenerate replay, guided regenerate override, cleared-input replay from a guided swipe, `/impersonate`, and guided impersonate regenerate against a local mock provider. ## Docs and release impact - [x] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Version/release files updated (only if this PR includes a version bump) No version or release files changed. A follow-up docs note may be useful to explain stored replay/guidance semantics to users. ## UI evidence (if applicable) Stored guidance modal was checked in the Chromium pass, but no screenshots are attached yet. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * View "Stored guidance" details for messages via a new modal. * Regenerations now persist and reapply stored generation guidance and impersonation settings for more reliable reproductions. * Shared generation-guide utilities and types added to public API. * **Tests** * Added test coverage for generation-replay behavior across regenerate scenarios. <!-- review_stack_entry_start --> [![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/Pasta-Devs/Marinara-Engine/pull/822) <!-- review_stack_entry_end --> <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:10:41 +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#4791
No description provided.