[GH-ISSUE #7430] Roleplay: agents don't see whispers in their context #4140

Closed
opened 2026-10-21 06:11:35 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @SpicyMarinara on GitHub (Oct 11, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/7430

Originally assigned to: @SpicyMarinara on GitHub.

Problem

In Roleplay chats, Echo Chamber and every other agent miss whispers entirely. A whisper is saved privately with its message, and only its recipient (and the appointed narrator) get it in their prompt. Agents never do, so:

  • Echo Chamber reacts to a turn as if nothing was said when the user only whispered to a character.
  • A message that is only a whisper vanishes for agents: its visible text is empty, and the agent executor drops messages with empty content.
  • Post-generation agents (trackers, Illustrator, Lorebook Keeper, Long-Term Memory and the rest) never learn what a character whispered in the reply they are processing.

Cause

Roleplay whispers live in message extra (roleplayCommandActivity, read with getRoleplayWhispers, placed with getRoleplayCommandContentOffset). Character responders get them through appendRoleplayWhispers (packages/server/src/services/generation/roleplay-commands.ts) only when they are the recipient or the appointed narrator. generate.routes.ts states that "Private state enters only the final responder request, after shared agent context". Agents get history built from visible message text only:

  • agentContext.recentMessages / routingContext.recentMessages
  • sharedPromptForAgents / publicRoleplayPrompt for agentContext.memory._mainPromptPreview
  • Long-Term Memory recall messages
  • retry-agents route contexts
  • lorebook-keeper-utils
  • Illustrator background generation
  • tool-resolution-runtime
  • mainResponse for post-generation agents
  • capability-package agent contexts

A whisper-only message has empty text and agent-executor.ts filters out messages with empty content.

Decided behaviour

  • Every agent (including Lorebook Keeper and Long-Term Memory) sees each live whisper (not deleted, no error) in Roleplay chats, at its saved place in its message, marked plainly as private with its recipient, for example [Private whisper to Maukie: text].
  • A whisper-only message appears to agents as its whisper(s). Whispers in the reply being generated reach post-generation agents, and a whisper the user just typed reaches pre-generation agents such as Echo Chamber.
  • One shared helper renders a message's agent-visible text, used wherever agent history text is built.
  • What character responders receive does not change: non-recipients still never see a whisper. Advanced Memory records and the responder's Peek Prompt stay the same.
  • Hosted multiplayer rooms keep today's behaviour (agents get no whispers), because agent output there is seen by every human participant.

Owner: @SpicyMarinara (Claude Code agent working on it)

Originally created by @SpicyMarinara on GitHub (Oct 11, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/7430 Originally assigned to: @SpicyMarinara on GitHub. ## Problem In Roleplay chats, Echo Chamber and every other agent miss whispers entirely. A whisper is saved privately with its message, and only its recipient (and the appointed narrator) get it in their prompt. Agents never do, so: - Echo Chamber reacts to a turn as if nothing was said when the user only whispered to a character. - A message that is only a whisper vanishes for agents: its visible text is empty, and the agent executor drops messages with empty content. - Post-generation agents (trackers, Illustrator, Lorebook Keeper, Long-Term Memory and the rest) never learn what a character whispered in the reply they are processing. ## Cause Roleplay whispers live in message `extra` (`roleplayCommandActivity`, read with `getRoleplayWhispers`, placed with `getRoleplayCommandContentOffset`). Character responders get them through `appendRoleplayWhispers` (`packages/server/src/services/generation/roleplay-commands.ts`) only when they are the recipient or the appointed narrator. `generate.routes.ts` states that "Private state enters only the final responder request, after shared agent context". Agents get history built from visible message text only: - `agentContext.recentMessages` / `routingContext.recentMessages` - `sharedPromptForAgents` / `publicRoleplayPrompt` for `agentContext.memory._mainPromptPreview` - Long-Term Memory recall messages - `retry-agents` route contexts - `lorebook-keeper-utils` - Illustrator background generation - `tool-resolution-runtime` - `mainResponse` for post-generation agents - capability-package agent contexts A whisper-only message has empty text and `agent-executor.ts` filters out messages with empty content. ## Decided behaviour - Every agent (including Lorebook Keeper and Long-Term Memory) sees each live whisper (not deleted, no error) in Roleplay chats, at its saved place in its message, marked plainly as private with its recipient, for example `[Private whisper to Maukie: text]`. - A whisper-only message appears to agents as its whisper(s). Whispers in the reply being generated reach post-generation agents, and a whisper the user just typed reaches pre-generation agents such as Echo Chamber. - One shared helper renders a message's agent-visible text, used wherever agent history text is built. - What character responders receive does not change: non-recipients still never see a whisper. Advanced Memory records and the responder's Peek Prompt stay the same. - Hosted multiplayer rooms keep today's behaviour (agents get no whispers), because agent output there is seen by every human participant. Owner: @SpicyMarinara (Claude Code agent working on it)
bsakaguchi 2026-10-21 06:11:35 +07:00
  • closed this issue
  • added the
    in-pr
    bug
    labels
Author
Owner

@SpicyMarinara commented on GitHub (Oct 11, 2026):

Fixed on staging by #7437. In Roleplay, every agent the Engine runs now reads whispers, including Smart response order. Each whisper sits at its place in the message and is marked private with its recipient. Hosted multiplayer rooms are the exception. Agent packages that read the chat themselves follow in Pasta-Devs/Marinara-Engine#7443 and Pasta-Devs/Marinara-Agents#1309.

<!-- gh-comment-id:6111609162 --> @SpicyMarinara commented on GitHub (Oct 11, 2026): Fixed on staging by #7437. In Roleplay, every agent the Engine runs now reads whispers, including Smart response order. Each whisper sits at its place in the message and is marked private with its recipient. Hosted multiplayer rooms are the exception. Agent packages that read the chat themselves follow in Pasta-Devs/Marinara-Engine#7443 and Pasta-Devs/Marinara-Agents#1309.
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#4140
No description provided.