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#1837
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 8, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3392
Originally assigned to: @SpicyMarinara on GitHub.
Follow-up to #3322 (closed / marked fixed for v2.1.1). A user reports it's still happening on current
main, and it is — the fix was applied but doesn't work because of the guard it uses.What's wrong
Creating a Roleplay chat via the wizard's "Use Settings Presets" shortcut still opens the chat with no first message — only the "X has joined the chat" system notice — exactly like the original #3322 report.
Why the fix doesn't work
The #3322 fix added
seedInitialGreetingsIfEmpty()tohandleShortcutApply, guarded to seed the greeting only when the chat is "empty." But the guard uses the total message count, and by the time it runs the chat already contains the system "joined the chat" notices — socount > 0is always true, the guard returns early, and the greeting is never posted.The original issue's proposed fix specifically said to guard on "no non-system messages yet." The implementation guards on total messages instead, which includes those system join notices.
How to reproduce (try it yourself)
first_mes.You'll see: the chat opens with no first message — only the "X has joined the chat" notice (same as #3322).
Expected: the character's
first_mesis posted as the opening assistant message (with alternate greetings as swipes), like the full step-by-step wizard path.Where it is
packages/client/src/components/chat/ChatSetupWizard.tsx—seedInitialGreetingsIfEmpty(lines 1998-2009):called from
handleShortcutApply(lines 2013 and 2023).countMessages(packages/server/src/services/storage/chats.storage.ts:791-794), which counts all rows with no role filter:role: "system"messages, created when characters are added to the chat (packages/server/src/routes/chats.routes.ts:715-721), which happens during the wizard — before Apply & Start.So by the time
seedInitialGreetingsIfEmptyruns,countalready includes those system messages →count > 0→ early return → no greeting. (For contrast, the full step-by-step pathfinishWizard, lines 1987-1996, callscreateInitialGreetingForCharacterunconditionally, which is why it still works.)What's happening
The guard was meant to avoid duplicating the greeting in the character-card quick-start flow (where an assistant greeting is pre-injected). But it keys on total message count including system join notices, so in the "New Roleplay wizard" flow — where only system notices exist, no greeting — it wrongly concludes the chat is non-empty and skips seeding.
Suggested fix
Guard on the presence of a non-system message (an actual greeting / assistant / user message), not the total count — matching the original issue's stated intent ("no non-system messages yet"). Options:
role === "system"(and likely"narrator"), or fetch the messages and check.first_mes) already exists before seeding, so the character-card quick-start dedup still holds while the wizard flow seeds correctly.AI-investigated against current
main(v2.1.1 tree; fix from commit2f3bef600"[codex] v2.1.1 issue sweep #3331" is present but ineffective). The guard,countMessages, and the system-join-notice creation were all read and confirmed. Please verify in-app before fixing.@SpicyMarinara commented on GitHub (Jul 8, 2026):
Fixed in PR #3396, merged into staging at
d22ba7af.