[PR #2455] [MERGED] generation: preserve conversation preset summaries #5612

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/2455
Author: @Promansis
Created: 6/6/2026
Status: ✅ Merged
Merged: 6/6/2026
Merged by: @Promansis

Base: refactor ← Head: fix/issue-2447-chat-summary-injection


📝 Commits (1)

  • 9189edd generation: preserve conversation preset summaries

📊 Changes

3 files changed (+127 additions, -5 deletions)

View changed files

📝 src/engine/generation/prompt-assembly.test.ts (+102 -0)
📝 src/engine/generation/prompt-assembly.ts (+25 -3)
📝 src/engine/generation/prompt-preset-selection.ts (+0 -2)

📄 Description

Linked issue

Closes #2447

Why this change

Conversation prompt presets with prompt sections but no chat_summary marker skipped compiled chat summaries instead of using the legacy fallback insertion path. That meant generated conversation prompts could lose summary context even though explicit summary markers and the no-preset fallback still worked.

What changed

  • Allow conversation chats to select request/chat prompt presets in the generation preset candidate path.
  • Add a summary fallback predicate for selected presets without an explicit chat_summary marker.
  • Keep explicit summary marker placement unchanged and avoid duplicate summary insertion.
  • Add focused prompt assembly coverage for conversation preset fallback insertion and marker no-duplication.

Refactor impact

Primary owner:

engine generation

Impact areas reviewed:

  • Conversation/chat prompt assembly
  • Roleplay summary fallback path
  • Game prompt path
  • Prompt preset selection

Boundary notes:

  • Engine-only change; no React UI, shared API, Tauri/Rust, storage schema, or remote runtime route changes.
  • Connection-level prompt preset override remains limited to roleplay/legacy visual-novel modes.

Pressure points touched:

  • src/engine/generation/prompt-assembly.ts
  • src/engine/generation/prompt-preset-selection.ts

Validation

  • Matching validation command passes locally (for example pnpm typecheck, pnpm build, pnpm check:architecture, pnpm check:docs, or full pnpm check when warranted)
  • Full pnpm check passes before PR push/handoff
  • Human/manual validation completed by contributor or reviewer

Manual verification notes

  • pnpm exec vitest run src/engine/generation/prompt-assembly.test.ts
  • pnpm typecheck
  • pnpm check

Durable test rationale: the regression silently drops compiled chat summary context from conversation prompt presets. Existing tests covered nearby roleplay/lore prompt assembly behavior but not conversation summary fallback or marker no-duplication. The new tests are narrow assembler rows that exercise only selected conversation presets with and without the chat_summary marker.

Feature Discoverability

Check exactly one:

  • Updated src/features/shell/discovery/ because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool.
  • N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find.

Reason:

Bugfix for existing prompt assembly behavior.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

UI evidence

N/A. Engine prompt assembly bugfix; no visible UI change.


🔄 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/2455 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 6/6/2026 **Status:** ✅ Merged **Merged:** 6/6/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `refactor` ← **Head:** `fix/issue-2447-chat-summary-injection` --- ### 📝 Commits (1) - [`9189edd`](https://github.com/Pasta-Devs/Marinara-Engine/commit/9189eddaace7335f94d6f37a8fa85d26c83eb78d) generation: preserve conversation preset summaries ### 📊 Changes **3 files changed** (+127 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `src/engine/generation/prompt-assembly.test.ts` (+102 -0) 📝 `src/engine/generation/prompt-assembly.ts` (+25 -3) 📝 `src/engine/generation/prompt-preset-selection.ts` (+0 -2) </details> ### 📄 Description ## Linked issue Closes #2447 ## Why this change Conversation prompt presets with prompt sections but no `chat_summary` marker skipped compiled chat summaries instead of using the legacy fallback insertion path. That meant generated conversation prompts could lose summary context even though explicit summary markers and the no-preset fallback still worked. ## What changed - Allow conversation chats to select request/chat prompt presets in the generation preset candidate path. - Add a summary fallback predicate for selected presets without an explicit `chat_summary` marker. - Keep explicit summary marker placement unchanged and avoid duplicate summary insertion. - Add focused prompt assembly coverage for conversation preset fallback insertion and marker no-duplication. ## Refactor impact Primary owner: engine generation Impact areas reviewed: - Conversation/chat prompt assembly - Roleplay summary fallback path - Game prompt path - Prompt preset selection Boundary notes: - Engine-only change; no React UI, shared API, Tauri/Rust, storage schema, or remote runtime route changes. - Connection-level prompt preset override remains limited to roleplay/legacy visual-novel modes. Pressure points touched: - `src/engine/generation/prompt-assembly.ts` - `src/engine/generation/prompt-preset-selection.ts` ## Validation - [x] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [x] Full `pnpm check` passes before PR push/handoff - [ ] Human/manual validation completed by contributor or reviewer ### Manual verification notes - `pnpm exec vitest run src/engine/generation/prompt-assembly.test.ts` - `pnpm typecheck` - `pnpm check` Durable test rationale: the regression silently drops compiled chat summary context from conversation prompt presets. Existing tests covered nearby roleplay/lore prompt assembly behavior but not conversation summary fallback or marker no-duplication. The new tests are narrow assembler rows that exercise only selected conversation presets with and without the `chat_summary` marker. ## Feature Discoverability Check exactly one: - [ ] Updated `src/features/shell/discovery/` because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool. - [x] N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find. Reason: Bugfix for existing prompt assembly behavior. ## Docs and release impact - [x] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [x] Confirmed this PR does not restore old staging/package-workspace/release claims ## UI evidence N/A. Engine prompt assembly bugfix; no visible UI change. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:17:49 +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#5612
No description provided.