mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #5199] [Issue]: Roleplay Long-Term Memory recall is silently dropped when a custom preset marker is unmatched #2875
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#2875
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 @Promansis on GitHub (Aug 17, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5199
Originally assigned to: @Promansis on GitHub.
Summary
Long-Term Memory retrieves memories successfully in Roleplay chats using custom prompt presets, but the recalled text can be silently dropped before the provider request when the preset-owned runtime marker is not matched.
Expected behavior
When Long-Term Memory selects memories, the selected text should be delivered into the final model prompt, either at the configured custom-preset marker or through the normal fallback injection path. The injection receipt should record the confirmed delivery.
Actual behavior
On Engine 2.4.1, a Roleplay chat with a custom XML prompt preset selected 20 memories and serialized approximately 2.7-2.8K tokens, confirmed by
recall_explanationdebug events. The final prompt contained no memory text and no runtime marker, andGET /api/long-term-memory/last-injection/<chatId>returned{"memoryCount":0,"tokenCount":0,"memories":[]}. No warning or error was emitted.Steps to reproduce
{{agent::long-term-memory}}and{"type":"agent_data","agentType":"long-term-memory"}.recall_explanationevent, the assembled prompt, andGET /api/long-term-memory/last-injection/<chatId>.Environment
c0ce4d88Logs, screenshots, or video
The associated debug log records
embeddingsAvailable: true, 20 selected memories, approximately 2.7-2.8K serialized tokens, and lower-rank overflow for rejected candidates. The reporter also captured an assembled-prompt view showing no memory section, runtime token, macro text, or recalled content.Additional context
Conversation mode with the same vault works, and a valid custom marker path passes the current prompt regression. The failure is in the Engine generation handoff: custom presets set
presetOwnsAgentPlacement = true; ifreplaceRuntimeAgentSectionreturns false, the current code drops the recall and receipt instead of usingappendSeparateAgentInjection.Requested fix:
Temporary workaround: use Roleplay without a custom prompt preset, or use Conversation mode.
Template check