[PR #7046] [MERGED] fix(roleplay): include macro-referenced characters in narrator avatars #7441

Closed
opened 2026-10-23 04:19:49 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7046
Author: @SpicyMarinara
Created: 10/4/2026
Status: ✅ Merged
Merged: 10/4/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/narrator-macro-avatars-7045


📝 Commits (3)

  • 6aae4d7 chore: track narrator macro avatar fix
  • b203c71 fix(roleplay): include ID-macro references in narrator avatars
  • 22943ed fix(roleplay): preserve narrator references when continuing replies

📊 Changes

8 files changed (+511 additions, -8 deletions)

View changed files

📝 CHANGELOG.md (+2 -0)
➕ e2e/narrator-macro-avatars.e2e.ts (+319 -0)
📝 packages/client/src/components/chat/ChatMessage.tsx (+21 -6)
📝 packages/server/src/routes/generate.routes.ts (+25 -0)
📝 packages/server/src/services/prompt/assembler.ts (+3 -0)
📝 packages/shared/src/types/chat.ts (+2 -0)
📝 scripts/regressions/active-character-reference.regression.ts (+46 -2)
📝 scripts/regressions/character-id-macro-modes.regression.ts (+93 -0)

📄 Description

Linked issue

Closes #7045

Why this change

In Roleplay groups using Merged (Narrator), a character loaded through an ID macro could be present in the prompt while their avatar was missing from the narrator's cycle. These references should affect the avatars without adding characters to the group or changing who speaks.

What changed

  • Save the existing macro discovery result, including activated lorebook references, with each generated reply and swipe.
  • Fetch compact portrait data for those references and append valid outside characters only to the merged Roleplay avatar list. Actual membership, inactive-member filtering, prompts, and speaker selection remain unchanged.
  • Keep earlier references when continuing the same reply, and clear stale references on regeneration or outside this mode; switching swipes restores each saved snapshot. Existing replies without a snapshot retain member avatars until regenerated.
  • Add an Unreleased changelog entry and focused server/browser regressions.

Validation

Passed locally:

  • pnpm check (localization, formatting, lint/types, production build).
  • pnpm regression:prompt; focused active-character-reference, character-id-macro-modes, and open-issues regressions.
  • pnpm smoke:ui (7 checks).
  • Focused browser suite: 6 desktop checks plus actual avatar cycling on mobile Chromium and WebKit (8 passed; 10 duplicate mode/generation cases intentionally desktop-only). Covers real lorebook-triggered generation, regeneration and swipe restoration; actual avatar cycling; duplicate/missing/portraitless/inactive references; unchanged membership; single Roleplay, individual Roleplay, Conversation and Game negative cases.
  • Docker arm64 build and node scripts/smoke-container.mjs marinara-7045-continuation full arm64 (frontend/API, native modules, persistence, shutdown).
  • Local CodeRabbit review completed, and its two minor test suggestions were applied. GitHub review then identified continuation snapshot preservation and a negative-test timing gap; both were fixed. The follow-up local review reported no findings. The continuation regression fails against the previous code and passes with the fix.

The change reuses existing macro discovery and does not alter prompt resolution or card-injection limits. References are presentation metadata, not group membership.

  • Manually verify macro-referenced avatars with your own lorebooks in a merged Roleplay group.
  • Manually verify saved swipe changes and unchanged group settings.
  • Manually verify avatar cycling on physical Android and iOS devices; local mobile proof uses browser emulation.

Docs and release impact

User-facing Unreleased changelog entry added. No version bump or translated documentation change.

UI evidence

Before/after browser screenshots and fixture details.

Owner: @SpicyMarinara. Implementation and automated validation by Codex.

Summary by CodeRabbit

  • New Features
    • In merged group roleplay, character references in replies can add those characters’ avatars to the reply’s avatar cycle without adding them to the group.
    • Each reply and swipe displays avatars based on its own character references, including references captured during generation.
  • Bug Fixes
    • Avatar references are limited to valid characters, and switching or regenerating replies no longer carries over stale references.
    • Other chat modes do not display referenced characters as narrator avatars.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/7046 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/4/2026 **Status:** ✅ Merged **Merged:** 10/4/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/narrator-macro-avatars-7045` --- ### 📝 Commits (3) - [`6aae4d7`](https://github.com/Pasta-Devs/Marinara-Engine/commit/6aae4d7e5b5c7c2d3115c54d40353226c08d7fcb) chore: track narrator macro avatar fix - [`b203c71`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b203c71643c595b674706bbfa91aac77e0baa57c) fix(roleplay): include ID-macro references in narrator avatars - [`22943ed`](https://github.com/Pasta-Devs/Marinara-Engine/commit/22943ed38a0b6e8a70253c5573905e86dce6039e) fix(roleplay): preserve narrator references when continuing replies ### 📊 Changes **8 files changed** (+511 additions, -8 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+2 -0) ➕ `e2e/narrator-macro-avatars.e2e.ts` (+319 -0) 📝 `packages/client/src/components/chat/ChatMessage.tsx` (+21 -6) 📝 `packages/server/src/routes/generate.routes.ts` (+25 -0) 📝 `packages/server/src/services/prompt/assembler.ts` (+3 -0) 📝 `packages/shared/src/types/chat.ts` (+2 -0) 📝 `scripts/regressions/active-character-reference.regression.ts` (+46 -2) 📝 `scripts/regressions/character-id-macro-modes.regression.ts` (+93 -0) </details> ### 📄 Description ## Linked issue Closes #7045 ## Why this change In Roleplay groups using Merged (Narrator), a character loaded through an ID macro could be present in the prompt while their avatar was missing from the narrator's cycle. These references should affect the avatars without adding characters to the group or changing who speaks. ## What changed - Save the existing macro discovery result, including activated lorebook references, with each generated reply and swipe. - Fetch compact portrait data for those references and append valid outside characters only to the merged Roleplay avatar list. Actual membership, inactive-member filtering, prompts, and speaker selection remain unchanged. - Keep earlier references when continuing the same reply, and clear stale references on regeneration or outside this mode; switching swipes restores each saved snapshot. Existing replies without a snapshot retain member avatars until regenerated. - Add an Unreleased changelog entry and focused server/browser regressions. ## Validation Passed locally: - `pnpm check` (localization, formatting, lint/types, production build). - `pnpm regression:prompt`; focused `active-character-reference`, `character-id-macro-modes`, and `open-issues` regressions. - `pnpm smoke:ui` (7 checks). - Focused browser suite: 6 desktop checks plus actual avatar cycling on mobile Chromium and WebKit (8 passed; 10 duplicate mode/generation cases intentionally desktop-only). Covers real lorebook-triggered generation, regeneration and swipe restoration; actual avatar cycling; duplicate/missing/portraitless/inactive references; unchanged membership; single Roleplay, individual Roleplay, Conversation and Game negative cases. - Docker arm64 build and `node scripts/smoke-container.mjs marinara-7045-continuation full arm64` (frontend/API, native modules, persistence, shutdown). - Local CodeRabbit review completed, and its two minor test suggestions were applied. GitHub review then identified continuation snapshot preservation and a negative-test timing gap; both were fixed. The follow-up local review reported no findings. The continuation regression fails against the previous code and passes with the fix. The change reuses existing macro discovery and does not alter prompt resolution or card-injection limits. References are presentation metadata, not group membership. - [ ] Manually verify macro-referenced avatars with your own lorebooks in a merged Roleplay group. - [ ] Manually verify saved swipe changes and unchanged group settings. - [ ] Manually verify avatar cycling on physical Android and iOS devices; local mobile proof uses browser emulation. ## Docs and release impact User-facing Unreleased changelog entry added. No version bump or translated documentation change. ## UI evidence [Before/after browser screenshots and fixture details](https://gist.github.com/SpicyMarinara/7f19d81788fa1f0dcd5ff25a233d02ce). Owner: @SpicyMarinara. Implementation and automated validation by Codex. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * In merged group roleplay, character references in replies can add those characters’ avatars to the reply’s avatar cycle without adding them to the group. * Each reply and swipe displays avatars based on its own character references, including references captured during generation. * **Bug Fixes** * Avatar references are limited to valid characters, and switching or regenerating replies no longer carries over stale references. * Other chat modes do not display referenced characters as narrator avatars. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-23 04:19:49 +07:00
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#7441
No description provided.