mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #526] [Issue]: Narrative Director leakage causes main AI double-responses #243
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#243
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @cha1latte on GitHub (May 7, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/526
Summary
Narrative Director, and potentially other text-based
pre_generationagents, can leak in-character roleplay text and<committed_tracker_state>JSON into their output. That leaked text can then be converted into ausermessage before the main generation request, causing the main AI to respond to the leaked content instead of the actual story.Expected behavior
Only the intended Narrative Director payload, such as the director note or structured agent output, should reach the prompt assembler. Hallucinated roleplay text, tracker JSON, or conversational filler from an agent response should not be injected into the main model prompt as user content.
Actual behavior
The Narrative Director sometimes outputs roleplay and
<committed_tracker_state>JSON before or alongside its intended note. Because trailing system messages are converted to user messages for provider API safety, the leaked agent output can be read by the main AI as if the user typed it. This can produce a jarring double-response or hallucinated continuation.Steps to reproduce
pre_generationagent.User -> Assistant roleplay -> <committed_tracker_state>.Environment
7e37df8Logs, screenshots, or video
Discord source:
https://discord.com/channels/1417099416812392641/1501980110390169630
Reporter's root-cause summary:
recentMessages, which are heavily patterned withUser -> Assistant roleplay -> <committed_tracker_state>. The LLM may continue that pattern despite the agent prompt.generate.routes.ts, trailing system messages are converted into user messages for API safety. If the Director's leaked text is returned as part of the agent output, the main AI receives that leak as user content.Relevant area mentioned by the reporter:
agent-executor.ts, especiallyparseAgentResponsegenerate.routes.ts, especiallyprepareProviderMessagesAdditional context
The reporter proposed two possible fixes:
parseAgentResponseso only the intended XML/bracketed agent payload is returned and conversational filler/pattern hallucinations are discarded.{, to reduce the chance of prose or roleplay leakage.The reporter also noted that the deeper fix may be to filter
<committed_tracker_state>out ofrecentMessagesbefore feeding pacing/director agents, since those agents likely do not need raw tracker JSON to evaluate narrative flow.Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked: