[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

Closed
opened 2026-10-21 05:43:08 +07:00 by bsakaguchi · 2 comments
Owner

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)

  1. Create an RP group chat with 2+ character cards — e.g. a "Narrator/GM" card and a character like "Isabella" who has a real description in her card. Set group replies to individual (characters reply one at a time), and use no lorebook.
  2. Prompt so the Narrator/GM responds, and ask it about Isabella (her appearance, who she is, etc.).

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 by resolvePromptCharacterIdsForTarget (packages/server/src/routes/generate/generate-route-utils.ts:911-919):

export function resolvePromptCharacterIdsForTarget(characterIds, targetCharacterId) {
  if (typeof targetCharacterId === "string" && characterIds.includes(targetCharacterId)) {
    return [targetCharacterId];   // ← only the responder's card
  }
  return characterIds;            // all cards, when there is no single target
}

The returned promptCharacterIds is 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, so promptCharacterIds = 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

  • When generating for one character in a group (individual mode), also include the other active group members' card info — at least name + a short description (like SillyTavern's "join character cards") — so characters are aware of who's present. A concise/summarized form could keep token cost down.
  • Or add an opt-in: a chat setting ("include other characters' cards in group replies") and/or a per-character "sees the whole group" flag, so narrator/GM cards can be set to see everyone.
  • In the meantime, the behavior is worth documenting with the workarounds: merged group mode includes all cards; or put shared cast info in a lorebook or in the narrator's own card.

AI-investigated against current main (v2.1.1); resolvePromptCharacterIdsForTarget, the target/promptCharacterIds wiring, 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.

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)** 1. Create an RP group chat with 2+ character cards — e.g. a "Narrator/GM" card and a character like "Isabella" who has a real description in her card. Set group replies to **individual** (characters reply one at a time), and use no lorebook. 2. Prompt so the **Narrator/GM** responds, and ask it about Isabella (her appearance, who she is, etc.). **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 by `resolvePromptCharacterIdsForTarget` (`packages/server/src/routes/generate/generate-route-utils.ts:911-919`): ``` export function resolvePromptCharacterIdsForTarget(characterIds, targetCharacterId) { if (typeof targetCharacterId === "string" && characterIds.includes(targetCharacterId)) { return [targetCharacterId]; // ← only the responder's card } return characterIds; // all cards, when there is no single target } ``` The returned `promptCharacterIds` is 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, so `promptCharacterIds` = 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** - When generating for one character in a group (individual mode), also include the other **active** group members' card info — at least name + a short description (like SillyTavern's "join character cards") — so characters are aware of who's present. A concise/summarized form could keep token cost down. - Or add an opt-in: a chat setting ("include other characters' cards in group replies") and/or a per-character "sees the whole group" flag, so narrator/GM cards can be set to see everyone. - In the meantime, the behavior is worth documenting with the workarounds: **merged** group mode includes all cards; or put shared cast info in a lorebook or in the narrator's own card. --- *AI-investigated against current `main` (v2.1.1); `resolvePromptCharacterIdsForTarget`, the target/`promptCharacterIds` wiring, 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.*
Author
Owner

@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:

  1. Client-driven single target (input.forCharacterId set) — resolvePromptCharacterIdsForTarget returns [target] (already in the issue), so the base prompt is built with only that card.

  2. Server-driven individual / "Smart" mode (input.forCharacterId null, so promptTargetCharacterId is null) — here the base prompt is built with all cards, and each other character's card is then actively stripped per responder by scopeIndividualGroupMessagesForTarget (packages/server/src/services/generation/prompt-message-scope.ts:232-276) via removeOtherCharacterProfileContent (128-158). That removes each other character's <Name>...</Name> XML block, ## Name markdown block, and — as a fallback — their exact card-field text. It's invoked at generate.routes.ts:4159-4162 for isGroupChat && 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:

  • Add an option to skip (or partially skip) scopeIndividualGroupMessagesForTarget — e.g. keep a short name + description block for the other active characters instead of removing them entirely.
  • For the client-driven path, include the other active characters in resolvePromptCharacterIdsForTarget.
  • A per-character "sees the whole group" flag would map cleanly onto exempting that character (a narrator/GM) from the scoping.
<!-- gh-comment-id:4919328731 --> @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: 1. **Client-driven single target** (`input.forCharacterId` set) — `resolvePromptCharacterIdsForTarget` returns `[target]` (already in the issue), so the base prompt is built with only that card. 2. **Server-driven individual / "Smart" mode** (`input.forCharacterId` null, so `promptTargetCharacterId` is null) — here the base prompt is built with **all** cards, and each other character's card is then **actively stripped per responder** by `scopeIndividualGroupMessagesForTarget` (`packages/server/src/services/generation/prompt-message-scope.ts:232-276`) via `removeOtherCharacterProfileContent` (128-158). That removes each other character's `<Name>...</Name>` XML block, `## Name` markdown block, and — as a fallback — their exact card-field text. It's invoked at `generate.routes.ts:4159-4162` for `isGroupChat && 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: - Add an option to skip (or partially skip) `scopeIndividualGroupMessagesForTarget` — e.g. keep a short name + description block for the other active characters instead of removing them entirely. - For the client-driven path, include the other active characters in `resolvePromptCharacterIdsForTarget`. - A per-character "sees the whole group" flag would map cleanly onto exempting that character (a narrator/GM) from the scoping.
Author
Owner

@SpicyMarinara commented on GitHub (Jul 8, 2026):

Intended behavior, we only want to append the card of a character currently responding.

<!-- gh-comment-id:4919426623 --> @SpicyMarinara commented on GitHub (Jul 8, 2026): Intended behavior, we only want to append the card of a character currently responding.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#1838
No description provided.