[PR #3353] [MERGED] fix: preserve Prose Guardian settings-based rules in merged rewrite prompt #5895

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

📋 Pull Request Information

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

Base: main ← Head: fix/merged-rewrite-preserve-settings-rules


📝 Commits (1)

  • 619978f fix: preserve Prose Guardian settings-based rules in merged rewrite prompt

📊 Changes

1 file changed (+34 additions, -1 deletions)

View changed files

📝 packages/server/src/services/generation/prose-guardian-settings.ts (+34 -1)

📄 Description

Summary

When multiple rewrite agents are merged, Prose Guardian's settings-based rules (banned, avoid, prefer) were silently dropped because buildMergedRewritePrompt only included promptTemplate — which is empty by design for Prose Guardian.

Changes

Updated buildMergedRewritePrompt in prose-guardian-settings.ts to:

  1. Only include promptTemplate if non-empty (avoids empty blocks)
  2. For Prose Guardian agents, explicitly include settings-based rules:
    • banned words/phrases
    • avoid instructions
    • prefer style instructions

Problem

When Prose Guardian was merged with another rewrite agent (e.g., Continuity Checker), the merged prompt had an empty instruction body. This caused:

  • The merged rewrite agent to return editNeeded:false in ~27 tokens
  • Prose Guardian's banned patterns (e.g., "A beat.") to pass through untouched
  • No prose-guardian agent-run to be recorded

Example

Before (broken):

<style_editor>
Agent: Prose Guardian

</style_editor>

After (fixed):

<style_editor>
Agent: Prose Guardian
BANNED WORDS/PHRASES: ozone
AVOID: no repetition of any phrases or sentence structure from the last messages
PREFER: concise, vivid prose
</style_editor>

Closes #3352

Summary by CodeRabbit

  • New Features

    • Improved how rewrite prompts are assembled for agents, making them more consistent and selective.
    • Prose-guardian agents now include configured guidance lines for banned words/phrases, avoid, and prefer rules when available.
  • Bug Fixes

    • Prompt blocks now only include optional agent prompt text when present, reducing unnecessary or empty content in generated output.

🔄 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/3353 **Author:** [@abhi-0203](https://github.com/abhi-0203) **Created:** 7/8/2026 **Status:** ✅ Merged **Merged:** 7/8/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `main` ← **Head:** `fix/merged-rewrite-preserve-settings-rules` --- ### 📝 Commits (1) - [`619978f`](https://github.com/Pasta-Devs/Marinara-Engine/commit/619978f91b01ffc9854f43b97e0e267ad0e9706c) fix: preserve Prose Guardian settings-based rules in merged rewrite prompt ### 📊 Changes **1 file changed** (+34 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/services/generation/prose-guardian-settings.ts` (+34 -1) </details> ### 📄 Description ## Summary When multiple rewrite agents are merged, Prose Guardian's settings-based rules (banned, avoid, prefer) were silently dropped because `buildMergedRewritePrompt` only included `promptTemplate` — which is empty by design for Prose Guardian. ## Changes Updated `buildMergedRewritePrompt` in `prose-guardian-settings.ts` to: 1. Only include `promptTemplate` if non-empty (avoids empty blocks) 2. For Prose Guardian agents, explicitly include settings-based rules: - `banned` words/phrases - `avoid` instructions - `prefer` style instructions ## Problem When Prose Guardian was merged with another rewrite agent (e.g., Continuity Checker), the merged prompt had an empty instruction body. This caused: - The merged rewrite agent to return `editNeeded:false` in ~27 tokens - Prose Guardian's banned patterns (e.g., "A beat.") to pass through untouched - No prose-guardian agent-run to be recorded ## Example Before (broken): ```xml <style_editor> Agent: Prose Guardian </style_editor> ``` After (fixed): ```xml <style_editor> Agent: Prose Guardian BANNED WORDS/PHRASES: ozone AVOID: no repetition of any phrases or sentence structure from the last messages PREFER: concise, vivid prose </style_editor> ``` Closes #3352 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Improved how rewrite prompts are assembled for agents, making them more consistent and selective. * Prose-guardian agents now include configured guidance lines for banned words/phrases, avoid, and prefer rules when available. * **Bug Fixes** * Prompt blocks now only include optional agent prompt text when present, reducing unnecessary or empty content in generated output. <!-- 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:04:54 +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#5895
No description provided.