mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #3445] [MERGED] feat(conversation): add {{replyRules}} macro to relocate custom emoji/sticker reply rules #5940
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#5940
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?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/3445
Author: @kolacheee
Created: 7/10/2026
Status: ✅ Merged
Merged: 7/10/2026
Merged by: @SpicyMarinara
Base:
staging← Head:feat/3438-reply-rules-macro📝 Commits (2)
6d39a80feat(conversation): add {{replyRules}} macro to relocate custom emoji/sticker reply rules8578a3fMerge branch 'staging' into feat/3438-reply-rules-macro📊 Changes
2 files changed (+34 additions, -5 deletions)
View changed files
📝
packages/server/src/routes/generate.routes.ts(+12 -1)📝
packages/server/src/routes/generate/conversation-custom-assets.ts(+22 -4)📄 Description
Linked issue
Refs #3438
Why this change
#3438 points out a clear parity gap: a preset can relocate the react-rules block with
{{reactRules}}, but the parallel custom-emoji/sticker reply advertisement — the "you can use custom emojis in your reply by writing:name:…" text, and the sticker equivalent — has no macro and is always force-appended to the first system message. So a preset author can move the react rules but not the emoji/sticker reply rules.What changed
Adds a
{{replyRules}}relocation macro that mirrors{{reactRules}}:packages/server/src/routes/generate.routes.ts: added areplyRuleskey (alias{{replyRules}}) toConversationContextMacroSlots, and wired a placement callback intoappendConversationCustomAssetAdvertisementswhen the slot is present.packages/server/src/routes/generate/conversation-custom-assets.ts: the emoji and sticker reply advertisements are now built into function-scope locals; at the end the helper either (a) renders the combined block at the{{replyRules}}macro (suppressing the auto append) via the callback, or (b) falls back to the historical behavior — append emoji then sticker to the first system message. When there are no advertisements the macro token is still stripped.Single macro covering both emoji and sticker reply rules; no emoji-only/sticker-only aliases, since every alias of a slot renders the same block (avoids accidental duplication).
Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Automated checks I ran locally (green):
pnpm --filter @marinara-engine/server lint(tsc -b ../shared && tsc --noEmit) — cleanpnpm regression:prompt— full prompt/macro regression suite passesStill to verify manually in the app (please tick above once done):
{{replyRules}}in the preset → confirm the reply advertisement(s) still append to the system message exactly as before (emoji then sticker).{{replyRules}}somewhere in the preset → confirm the reply advertisement(s) render at that spot and are not also appended at the top.{{replyRules}}present but the chat has no custom emojis/stickers → confirm the{{replyRules}}token is removed (no literal{{replyRules}}leaks into the prompt).{{reactRules}}(react rules) still behaves independently.Docs and release impact
Macro-reference docs for the conversation relocation macros are tracked in #3437 and will cover
{{replyRules}}alongside the others; no version bump here.UI evidence (if applicable)
N/A (prompt-assembly logic; no UI surface changed).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.