[PR #3834] [MERGED] Append Example Dialogue when its preset marker is absent #6122

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/3834
Author: @SpicyMarinara
Created: 7/19/2026
Status: ✅ Merged
Merged: 7/19/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/example-dialogue-marker-fallback-3833


📝 Commits (2)

  • d23c572 chore: start example dialogue fallback
  • f400d5a fix: append unplaced character dialogue examples

📊 Changes

4 files changed (+147 additions, -1 deletions)

View changed files

📝 docs/prompts/presets.md (+2 -0)
📝 packages/server/src/services/prompt/assembler.ts (+14 -0)
📝 packages/server/src/services/prompt/marker-expander.ts (+15 -1)
📝 scripts/regressions/prompt.regression.ts (+116 -0)

📄 Description

Linked issue

Closes #3833

Why this change

Roleplay character cards can contain Example Dialogue, but presets that use a Character marker without a separate Dialogue Examples marker silently omit it. The expanded named character block then suppresses the general identity fallback, so valid card content never reaches the model.

What changed

  • Detect whether the assembled preset has an enabled Dialogue Examples marker, including group enablement.
  • When it does not, append non-empty Example Dialogue inside Character Info after Scenario and before advanced character instructions.
  • Reuse the existing character-field sanitization and wrap engine, preserving XML, Markdown, and None formatting.
  • Preserve explicit Dialogue Examples marker placement without duplicating the content.
  • Document the fallback behavior and add prompt regression coverage.

Automated validation performed

  • pnpm regression:prompt — passed, including XML, Markdown, None, field order, and explicit-marker negative controls.
  • pnpm check — passed (workspace type checks, lint, and production builds).
  • git diff --check — passed.

Validation checklist

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (XML / Markdown / None, empty dialogue, explicit marker)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Manual verification notes

Manual Roleplay verification remains for a human contributor: generate once with Character Info and no Dialogue Examples marker, then once with an enabled Dialogue Examples marker, and inspect Peek Prompt for exactly one copy in the expected location.

Docs and release impact

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

Summary by CodeRabbit

  • New Features

    • Example Dialogue is now automatically included after Scenario when no enabled Dialogue Examples marker is configured.
    • Automatic placement respects the preset’s XML, Markdown, or unwrapped formatting.
    • Adding a Dialogue Examples marker provides explicit control over placement and prevents duplicate dialogue.
  • Documentation

    • Updated preset documentation to explain Example Dialogue placement and formatting behavior.

🔄 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/3834 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 7/19/2026 **Status:** ✅ Merged **Merged:** 7/19/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/example-dialogue-marker-fallback-3833` --- ### 📝 Commits (2) - [`d23c572`](https://github.com/Pasta-Devs/Marinara-Engine/commit/d23c5726706427d08a71c5e3d0b3cd577a727c63) chore: start example dialogue fallback - [`f400d5a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f400d5a7befc5236241b965e473fab5a3b7f6e1a) fix: append unplaced character dialogue examples ### 📊 Changes **4 files changed** (+147 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `docs/prompts/presets.md` (+2 -0) 📝 `packages/server/src/services/prompt/assembler.ts` (+14 -0) 📝 `packages/server/src/services/prompt/marker-expander.ts` (+15 -1) 📝 `scripts/regressions/prompt.regression.ts` (+116 -0) </details> ### 📄 Description ## Linked issue Closes #3833 ## Why this change Roleplay character cards can contain Example Dialogue, but presets that use a Character marker without a separate Dialogue Examples marker silently omit it. The expanded named character block then suppresses the general identity fallback, so valid card content never reaches the model. ## What changed - Detect whether the assembled preset has an enabled Dialogue Examples marker, including group enablement. - When it does not, append non-empty Example Dialogue inside Character Info after Scenario and before advanced character instructions. - Reuse the existing character-field sanitization and wrap engine, preserving XML, Markdown, and None formatting. - Preserve explicit Dialogue Examples marker placement without duplicating the content. - Document the fallback behavior and add prompt regression coverage. ## Automated validation performed - `pnpm regression:prompt` — passed, including XML, Markdown, None, field order, and explicit-marker negative controls. - `pnpm check` — passed (workspace type checks, lint, and production builds). - `git diff --check` — passed. ## Validation checklist - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (XML / Markdown / None, empty dialogue, explicit marker) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ## Manual verification notes Manual Roleplay verification remains for a human contributor: generate once with Character Info and no Dialogue Examples marker, then once with an enabled Dialogue Examples marker, and inspect Peek Prompt for exactly one copy in the expected location. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs as needed - [ ] Version/release files updated (only if this PR includes a version bump) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Example Dialogue is now automatically included after Scenario when no enabled Dialogue Examples marker is configured. * Automatic placement respects the preset’s XML, Markdown, or unwrapped formatting. * Adding a Dialogue Examples marker provides explicit control over placement and prevents duplicate dialogue. * **Documentation** * Updated preset documentation to explain Example Dialogue placement and formatting behavior. <!-- 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-23 04:07:18 +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#6122
No description provided.