mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #5423] [Issue]: Agent prompts leak encoded quotes and raw conditional macro wrappers #3006
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#3006
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 @SpicyMarinara on GitHub (Aug 22, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5423
Originally assigned to: @SpicyMarinara on GitHub.
Summary
Agent calls are receiving HTML-encoded quotes and raw conditional macro directive text in their final prompts. Debug logs show
"surviving inside a{{#if ...}}expression instead of resolving to a quote.For agent calls, the conditional wrapper itself is unnecessary context and wastes tokens. The enclosed authored content must remain, but the
{{#if ...}}/{{/if}}control syntax should not be sent to the agent model.Expected behavior
Given source content such as:
the agent-bound prompt should contain the useful inner text:
It should not contain
", the opening conditional expression, or the closing directive.Requirements:
"does not survive into debug output or the provider request.Actual behavior
The agent debug prompt includes content resembling:
The encoded quote is not resolved, and the raw conditional expression is sent to the model. This exposes implementation syntax to the agent and consumes tokens without adding useful context.
Steps to reproduce
"and the raw{{#if ...}}directive survive in the prompt instead of only the inner text being included.Environment
Logs, screenshots, or video
Observed debug-log fragment:
Additional context
Related to #5372, which fixed HTML-escaped lorebook tags in agent prompts. That fix covered escaped lorebook body characters such as
<and>; this report demonstrates that encoded quotes and conditional macro wrappers still leak through an agent prompt path.A focused regression should assert both properties together:
Template check