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#7827
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/7600
Author: @SpicyMarinara
Created: 10/14/2026
Status: ✅ Merged
Merged: 10/14/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/7585-send-resolves-macros📝 Commits (3)
03d87b2fix(commands): /send stores resolved macros like a normal send (#7585)e4a6eadfix(chat): wait for the persona and character lists before filling a sent message's macros4ccfb18fix(chat): only wait for the persona and character lists when the message has macros📊 Changes
8 files changed (+282 additions, -111 deletions)
View changed files
📝
e2e/roleplay-commands.e2e.ts(+42 -0)📝
packages/client/src/components/chat/ChatInput.tsx(+34 -47)📝
packages/client/src/components/chat/ConversationInput.tsx(+37 -50)📝
packages/client/src/hooks/use-characters.ts(+25 -13)📝
packages/client/src/lib/chat-macros.ts(+50 -0)📝
packages/client/src/lib/slash-commands.ts(+3 -1)📝
scripts/regressions/conversation-game-slash.regression.ts(+1 -0)➕
scripts/regressions/send-command-macros.regression.ts(+90 -0)📄 Description
Linked issue
Closes #7585
Why this change
{{random::red::green::blue}}is saved as one word and the chat and the model both see that word./sendsaved the text exactly as typed. The chat then showed one roll and the model's prompt rolled again with a different seed, so the two disagreed (the repro in #7585:/send ... {{random::...}}then/continue)./sendalso skipped the other steps a normal send runs: the chat's user-input regex scripts and input translation.What changed
/sendnow saves exactly what Send and Post only save. All three use one shared step,prepareUserInputMessageinpackages/client/src/lib/chat-macros.ts. It runs the user-input regex scripts, then input translation if the chat has it turned on, then the macros.prepareUserMessagein their context. Both chat inputs (RoleplayChatInputand ConversationConversationInput) now provide it, including the quick-button command paths. Because the field is required, TypeScript will flag any future composer that runs slash commands without it.{{...}}) now waits for the persona and character lists to finish loading before its macros are filled in. This applies to Send, Post only and/send. Before, a message sent in that moment was saved with "User" for{{user}}and "Character" for{{char}}instead of the real names. A message without macros never waits, and once the lists are loaded nothing waits. The wait reuses the list request that is already running (the list queries inuse-characters.tsare now shared with the existing hooks).e2e/roleplay-commands.e2e.ts(Roleplay and Conversation): it holds back the persona list, checks that/send Plain hello.is saved at once, then types/send Pick {{random::red::green}}, I am {{user}}.and checks that the saved message has one colour and the persona's name, and that the chat shows the saved text.scripts/regressions/send-command-macros.regression.ts. It runs the real/sendcommand, with and without quotes, and checks that{{random}},{{user}}, regex scripts, input translation and the translation-failure fallback all give the same saved text as a normal send. The existing/sendregression now passes the new context field. Its assertions are unchanged.Slash commands checked for the same problem:
/sysand/as <name> <message>also save text as typed, but no normal send produces system or character messages. Macros in a character's message are meant to stay live so{{char}}names that character, so these two are unchanged./impersonate <direction>and/guidedare never saved as messages. Their text only goes into one generation's prompt./randomand/as <name>(no message) save fixed text that the command writes itself./rollsaves dice output./sendare both saved raw on the server, so the two agree. Whether guest messages should fill in macros is a separate question and is not changed here./remindsaves its text as typed inside a narrator message, the same kind of case as/sys. Unchanged.{{random}}there can also show one roll in the Game log and give the model another. Game has no/send, and its send path deliberately skips regex and translation, so this needs its own follow-up and is not changed here.Validation
pnpm checkpasses locallyCONTRIBUTING.mdCommands run by the agent:
node ./scripts/run-regressions.mjs --filter scripts/regressions/send-command-macros.regression.ts: passes. With the old/sendcode it fails and the saved text still has the raw{{random::...}}, {{user}}.pnpm regression:prompt: 3/3 passed.conversation-game-slash,slash-command-usage,dice-notation,chat-persona-macros,character-identity,open-issues,roleplay-commands, plus the--filtergroupsmacro(4),slash(2),persona(5),regex(2) andtranslat(1): all passed.pnpm check: exit 0. The one lint warning is already on staging, inHomeProfessorMariChat.tsx./send Reply with the following word: {{random::...}}, {{user}}into a Roleplay chat and a Conversation chat. On staging, both saved the raw macros. With this branch, both saved one colour and the persona name, and the chat showed the same text.e2e/chat-sweep.e2e.ts"Personas are chosen per chat…" fails both on staging and on this branch. It times out on the persona picker's "Ungrouped" button, before it reaches its/sendstep.coderabbit review --agent --committed) on the first commit: 0 findings./send stores macros resolved like a normal sendpasses on desktop Chromium, mobile Chromium and mobile WebKit (6/6). It fails in both modes when the wait is removed (savesPick red, I am User.), when every message waits (the plain message isn't saved while the list is held), and when a chat input passes/sendan empty step (async (text) => text; saves the raw{{random::red::green}}and{{user}}).e2e/roleplay-commands.e2e.tson desktop Chromium: 21 passed, 1 failed. "Roleplay users send and edit private whispers and notes in Manual group chats" fails the same way without this PR, at the staging commit this branch is based on (it expects "This private command could not be read" and gets "Mari used whisper command!").{{waits.pnpm check: exit 0 (the same staging lint warning).pnpm regression:prompt: 3/3. The--filtergroupssend-command-macros,conversation-game-slash,slash,macro,persona,regex,translat,character-identityandopen-issuesall pass.Manual verification notes
/send Reply with the following word: {{random::red::green::blue::yellow::cyan::magenta}}saves one word. Then/continueand Peek prompt both show that same word./send I am {{user}}.saves your current persona's name./send, and that a message without macros sends right away./sendposts the translated text, the same as Post only./sendthe same way it applies to Send.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)UI evidence (if applicable)
No visual changes.
Summary by CodeRabbit
Bug Fixes
/sendnow processes messages consistently with regular chat input, including macros, user-input transformations, and translation.Tests
/sendmessage preparation in roleplay and conversation chats, including macro resolution and translation fallback.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.