mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2997] [Issue]: Retry wrap-format reads the preset wrapFormat for conversation/game modes, but the original generation always uses xml there #1571
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#1571
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 @kolacheee on GitHub (Jun 29, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2997
Originally assigned to: @SpicyMarinara on GitHub.
What's wrong
The retry route resolves the agent-context wrap format from the active prompt preset for ALL chat modes. But the main generate route only applies the preset's wrapFormat for roleplay/visual_novel — for conversation and game modes it stays at the hardcoded "xml" default. So for a conversation- or game-mode chat whose active preset declares wrapFormat "markdown" or "none", the retry route hands agents a DIFFERENT wrap format than the original generation did. The Secret Plot State agent-context block is wrapped as markdown/plain on retry but was XML at generation, changing the exact prompt the agent model sees.
How to reproduce (try it yourself)
You'll see: the agent context Secret Plot State block is wrapped per the preset (markdown/none) on retry instead of xml.
Expected: retry uses the same "xml" wrap format the original generation used for conversation/game chats.
Where it is
packages/server/src/routes/generate/retry-agents-route.ts:346-362(resolveRetryAgentWrapFormat) vspackages/server/src/routes/generate.routes.ts:1879(xml default) +:2170-2172(gated preset application). Consumed atpackages/server/src/services/agents/agent-executor.ts:2124-2131.What's happening
resolveRetryAgentWrapFormatapplies the preset wrapFormat unconditionally, not mirroring the main route'schatMode !== "conversation" && chatMode !== "game"gate that keeps conversation/game on the "xml" default.Suggested fix
Add an early guard at the top of
resolveRetryAgentWrapFormat, before building candidates:Leave the existing candidate loop and final
return "xml"unchanged for roleplay/visual_novel. ChatMode has exactly four values, so gating on these two fully and exclusively matches the original-generation behavior; roleplay/visual_novel keep resolving the preset wrapFormat as the main route also does for them.AI-investigated against v2.0.6; cited lines read and confirmed. Please verify before fixing.
@SpicyMarinara commented on GitHub (Jun 29, 2026):
Fixed in merged staging PR #3004.