mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #3394] [Issue]: RP group chat (individual and smart modes) only gives a character its own card — no info about the other characters in the scene #1838
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#1838
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/3394
What's wrong
In a Roleplay group chat where characters respond one at a time (individual mode), each character's prompt includes only that character's own card. The other characters currently in the group aren't included — so a responding character has no information about them (no description, personality, or appearance).
This is most visible with a "narrator" / "Gamemaster" style character card whose job is to describe scenes and reference the others: when it's the narrator's turn, its prompt contains only the narrator's own card, so it can't describe or answer about the other group members. When a normal character (e.g. "Isabella") responds, her card is used correctly — because then she is the target.
(User report, paraphrased: a GM/narrator card in an RP group can't tell them anything about the other characters — even when asked directly for "Isabella" — while Isabella's own turns use her card fine. There is no lorebook for the other characters.)
How to reproduce (try it yourself)
You'll see: the Narrator only knows its own card; it has no idea who Isabella is (invents or deflects), even though Isabella is in the same group scene.
Expected: a character generating in a group scene should at least know who else is present and have their basic card info, so a narrator/GM can describe them.
Where it is
packages/server/src/routes/generate.routes.ts— for a per-character group turn the target is the responder (1251-1254,promptTargetCharacterId = input.forCharacterId), and which cards get injected is decided byresolvePromptCharacterIdsForTarget(packages/server/src/routes/generate/generate-route-utils.ts:911-919):The returned
promptCharacterIdsis what's fed to the prompt / character-card assembly (used at 1269, 1384, 1414, 1491, 1840, 1898, …). So when a target is set (an individual group turn), only that one card is injected. There is no setting to include the other group members' cards (a grep for a "join cards" / include-all-characters option finds none). By contrast, merged group mode has no single target, sopromptCharacterIds= every character and all cards are included.What's happening
Individual group mode isolates each character to its own card (presumably to keep each reply in-character and save tokens). The side effect is that a character has zero knowledge of its co-present group members — which breaks the common expectation that group members are aware of who's in the scene, and especially breaks narrator/GM character cards whose whole purpose is to describe the others.
Suggested fix / options
AI-investigated against current
main(v2.1.1);resolvePromptCharacterIdsForTarget, the target/promptCharacterIdswiring, and the absence of an include-all-cards option were read and confirmed. Whether the isolation is intentional is a maintainer call — but the "a group character knows nothing about its scene-mates" outcome is real and reproducible. Please verify before deciding.@kolacheee commented on GitHub (Jul 8, 2026):
Update — the reporter narrowed it to "Smart" group mode, and that surfaced a second (and clearly intentional) mechanism this issue originally missed.
There are two code paths that both leave a responder with only its own card, and a fix needs to cover both:
Client-driven single target (
input.forCharacterIdset) —resolvePromptCharacterIdsForTargetreturns[target](already in the issue), so the base prompt is built with only that card.Server-driven individual / "Smart" mode (
input.forCharacterIdnull, sopromptTargetCharacterIdis null) — here the base prompt is built with all cards, and each other character's card is then actively stripped per responder byscopeIndividualGroupMessagesForTarget(packages/server/src/services/generation/prompt-message-scope.ts:232-276) viaremoveOtherCharacterProfileContent(128-158). That removes each other character's<Name>...</Name>XML block,## Namemarkdown block, and — as a fallback — their exact card-field text. It's invoked atgenerate.routes.ts:4159-4162forisGroupChat && groupChatMode === "individual" && chatMode !== "conversation" && targetCharId. "Smart" mode is a variant of that individual loop (groupResponseOrder === "smart", selected around 4048-4062), so it goes through this stripping — which is exactly what the user hit.So the isolation is intentional, not an accidental omission — there's a dedicated file whose whole job is to remove co-present characters' profiles so each reply stays "in character." That makes this squarely an enhancement / opt-in request rather than a code bug. To let a character (especially a narrator/GM) see its scene-mates:
scopeIndividualGroupMessagesForTarget— e.g. keep a short name + description block for the other active characters instead of removing them entirely.resolvePromptCharacterIdsForTarget.@SpicyMarinara commented on GitHub (Jul 8, 2026):
Intended behavior, we only want to append the card of a character currently responding.