mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
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#1865
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 (Jul 10, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3450
Summary
A post-merge review of #3449 (relocation macros in
{{#if}}) surfaced three regressions instaging: the current-context block is injected twice, a{{#if}}comparing to a relocation-alias string literal silently drops retrieval, and a deferred{{else}}branch keeps a stray blank line.Expected behavior
{{#if topic == "memories"}}(comparing to the literal string"memories") does not affect memory recall.{{#if}}…{{else}}…{{/if}}whose else branch is selected has no leading blank line — same as an evaluated block.Actual behavior
Context double-injection. A preset that references
{{context}}only inside a deferred conditional (e.g.{{#if context != ""}}…{{context}}…{{/if}}) leaves no literal{{context}}after deferral. The context tail-fallback keys onreplaceConversationContextMacro's return value, which isfalsefor a deferred token, so it pushes the context block as a trailing user message — and the decode pass also inlines it into the system prompt. Result: the context block (latest user message, status, activity, timestamp, mentions) is sent twice, every turn.generate.routes.ts~2110.Slot-detection over-match drops retrieval. Slot detection uses a loose regex over
{{#if …}}bodies (conversationContextMacroConditionPattern, ~499/528). For{{#if topic == "memories"}}or{{#if user.status == "x"}},\bmemories\b/\bstatus\bmatches inside the quoted literal / dotted operand, flippingslots.memories(or.status/.commands/.reactRules/.lorebook) true — but the parser-based defer predicate correctly declines. With the slot wrongly true, the code takes the "macro placed" branch (replace a bare{{memories}}that isn't there) instead of the normal recall injection, so memory recall / react rules / commands / lorebook silently vanish.Deferred else-branch blank line.
trimDeferredStandaloneBranches(macro-engine.ts~998) trims the leading newline only for branch index 0, but the evaluate-now path strips whichever branch is selected — so a selected{{else}}/{{else if}}branch keeps a stray blank line the inline path removes.Steps to reproduce
{{#if context != ""}}Current situation:\n{{context}}{{/if}}and no bare{{context}}→ context block appears twice.{{#if topic == "memories"}}…{{/if}}and no bare{{memories}}→ memory recall no longer injected.{{#if memories != ""}}…{{else}}…{{/if}}and empty memories → the else branch renders with a leading blank line.Environment
Logs, screenshots, or video
N/A — traced in code; fix PR incoming.
Additional context
Root cause of (1) and (2) is a slot-detection path that disagrees with the parser-based defer decision. Fix: drive slot detection from the actual deferred tokens (same parser) and key the context fallback on the slot, not the replace() return. Follow-up to #3449 / #3448.
Template check