[GH-ISSUE #3352] Multi-rewrite-agent merge (v2.0.9) silently drops settings-based rules — Prose Guardian stops editing when sharing a chat with another rewrite agent[Issue]: #1816

Closed
opened 2026-10-21 05:42:58 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @mgbraddy on GitHub (Jul 8, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3352

Originally assigned to: @SpicyMarinara on GitHub.

Summary
As of v2.0.9, when two or more built-in rewrite agents (prose-guardian, continuity, html) are active in the same chat, they're collapsed into one merged rewrite pass whose prompt is built only from each agent's promptTemplate. Prose Guardian's promptTemplate is empty by design — its ruleset lives in settings.banned/avoid/prefer — so the merge produces an instruction-less no-op and PG stops fixing prose.
Expected behavior
When Prose Guardian is merged with another rewrite agent, its settings-based rules (banned/avoid/prefer word lists) should be folded into the merged prompt, so it keeps enforcing them.
Actual behavior
The merged rewrite agent runs with an empty instruction body (both PG's and Continuity's promptTemplate are ""), returns editNeeded:false in ~27 tokens, and all the slop PG normally kills (e.g. the "A beat." fragment tic) passes through untouched. PG's own agent-run row never appears; the merged run is logged under the other agent's config ID, and baseAgent inherits that agent's settings, dropping PG's banned list entirely.
Steps to reproduce
In one chat, activate only Prose Guardian as a rewrite agent → it runs solo and edits correctly.
In a second chat (same characters/preset), activate both Prose Guardian and Continuity Checker (or Immersive HTML).
Generate messages containing PG's banned patterns (e.g. "A beat.").
Observe: in the solo chat PG rewrites them; in the two-rewrite-agent chat they pass through untouched, and no prose-guardian agent-run is recorded (a single merged text_rewrite runs under the other agent's ID as a ~27-token no-op).
Environment
Marinara Engine version: v2.0.9
Install type: source
OS + version: Windows 10
Browser or app shell: Chrome
Logs, screenshots, or video
Merge logic: packages/server/src/services/generation/prose-guardian-settings.ts — mergePairedBuiltInRewriteAgents (~L156) and buildMergedRewritePrompt (~L135) build the merged prompt from promptTemplate only.
PG's rules are injected separately via applyProseGuardianChatSettings from settings.banned/avoid/prefer, which the merge never reads.
Observed run: merged text_rewrite logged under Continuity's config ID, editNeeded:false, 27 tokens / ~5.7s.
Additional context
Suggested fix: in buildMergedRewritePrompt, run each agent's chat-settings transform (applyTextRewriteAgentChatSettings / applyProseGuardianChatSettings) and fold the resulting rules into the merged prompt before combining — don't rely on promptTemplate alone for agents whose rules live in settings.
Workaround: keep only one built-in rewrite agent active per chat (disabling Continuity restores PG).
Root-caused via Professor Mari on 2026-07-08.
Template check
[ ] I DID NOT read this template and provide the requested details.

Originally created by @mgbraddy on GitHub (Jul 8, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3352 Originally assigned to: @SpicyMarinara on GitHub. Summary As of v2.0.9, when two or more built-in rewrite agents (prose-guardian, continuity, html) are active in the same chat, they're collapsed into one merged rewrite pass whose prompt is built only from each agent's promptTemplate. Prose Guardian's promptTemplate is empty by design — its ruleset lives in settings.banned/avoid/prefer — so the merge produces an instruction-less no-op and PG stops fixing prose. Expected behavior When Prose Guardian is merged with another rewrite agent, its settings-based rules (banned/avoid/prefer word lists) should be folded into the merged prompt, so it keeps enforcing them. Actual behavior The merged rewrite agent runs with an empty instruction body (both PG's and Continuity's promptTemplate are ""), returns editNeeded:false in ~27 tokens, and all the slop PG normally kills (e.g. the "A beat." fragment tic) passes through untouched. PG's own agent-run row never appears; the merged run is logged under the other agent's config ID, and baseAgent inherits that agent's settings, dropping PG's banned list entirely. Steps to reproduce In one chat, activate only Prose Guardian as a rewrite agent → it runs solo and edits correctly. In a second chat (same characters/preset), activate both Prose Guardian and Continuity Checker (or Immersive HTML). Generate messages containing PG's banned patterns (e.g. "A beat."). Observe: in the solo chat PG rewrites them; in the two-rewrite-agent chat they pass through untouched, and no prose-guardian agent-run is recorded (a single merged text_rewrite runs under the other agent's ID as a ~27-token no-op). Environment Marinara Engine version: v2.0.9 Install type: source OS + version: Windows 10 Browser or app shell: Chrome Logs, screenshots, or video Merge logic: packages/server/src/services/generation/prose-guardian-settings.ts — mergePairedBuiltInRewriteAgents (~L156) and buildMergedRewritePrompt (~L135) build the merged prompt from promptTemplate only. PG's rules are injected separately via applyProseGuardianChatSettings from settings.banned/avoid/prefer, which the merge never reads. Observed run: merged text_rewrite logged under Continuity's config ID, editNeeded:false, 27 tokens / ~5.7s. Additional context Suggested fix: in buildMergedRewritePrompt, run each agent's chat-settings transform (applyTextRewriteAgentChatSettings / applyProseGuardianChatSettings) and fold the resulting rules into the merged prompt before combining — don't rely on promptTemplate alone for agents whose rules live in settings. Workaround: keep only one built-in rewrite agent active per chat (disabling Continuity restores PG). Root-caused via Professor Mari on 2026-07-08. Template check [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 05:42:58 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@SpicyMarinara commented on GitHub (Jul 8, 2026):

In PR.

<!-- gh-comment-id:4912919900 --> @SpicyMarinara commented on GitHub (Jul 8, 2026): In PR.
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#1816
No description provided.