[PR #6212] [MERGED] fix: retire global active personas and align chat identity #7091

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/6212
Author: @SpicyMarinara
Created: 9/14/2026
Status: ✅ Merged
Merged: 9/14/2026
Merged by: @SpicyMarinara

Base: staging ← Head: fix/persona-issue-sweep-6206


📝 Commits (3)

  • ad56c61 docs: track assigned persona issue sweep
  • cec53fb fix: retire global active personas and align chat identity
  • 4fa6f02 test: cover persona switching through desktop and mobile controls

📊 Changes

30 files changed (+361 additions, -342 deletions)

View changed files

📝 CHANGELOG.md (+2 -0)
📝 docs/characters/choosing-your-persona.md (+7 -28)
📝 docs/characters/personas.md (+8 -14)
📝 docs/noodle/overview.md (+1 -1)
📝 e2e/chat-sweep.e2e.ts (+131 -0)
📝 packages/client/src/components/characters/CharacterLibraryView.tsx (+1 -21)
📝 packages/client/src/components/chat/ChatArea.tsx (+6 -23)
📝 packages/client/src/components/chat/ConversationMessage.tsx (+9 -3)
📝 packages/client/src/components/panels/PersonasPanel.tsx (+8 -54)
📝 packages/client/src/components/panels/settings/TrackerCardColorSettings.tsx (+1 -4)
📝 packages/client/src/hooks/use-characters.ts (+0 -26)
📝 packages/client/src/lib/chat-macros.ts (+8 -6)
📝 packages/client/src/lib/persona-cache.ts (+2 -19)
📝 packages/client/src/localization/locales/en.json (+0 -1)
📝 packages/server/src/routes/characters.routes.ts (+7 -14)
📝 packages/server/src/routes/encounter.routes.ts (+2 -9)
📝 packages/server/src/routes/generate.routes.ts (+1 -2)
📝 packages/server/src/routes/generate/generate-route-utils.ts (+2 -2)
📝 packages/server/src/routes/scene.routes.ts (+2 -4)
📝 packages/server/src/services/chat-user-identity.ts (+2 -1)

...and 10 more files

📄 Description

Linked issue

Closes #6206
Closes #6207
Closes #6208

Why this change

Choosing None in a Conversation chat still used the global active persona, even though the switcher reported no selection. The Roleplay composer and server also disagreed about that fallback. Following the maintainer's decision in #6206, global active personas are retired: each chat uses its selected persona, or remains anonymous. Conversation messages now resolve {{user}} from the user identity instead of the speaking character's label.

What changed

  • Reuse the shared persona resolver for explicit chat selection in every mode. Remove implicit global fallback from rendering, composer macros, tracker color choices, and the obsolete setup-metadata UI fallback.
  • Remove the global activation button, Active/Inactive filters, badges, and unused active-persona hooks/cache handling. Existing persona library and chat selection controls remain available.
  • Correct Conversation display macros while preserving character headers, cosmetic display names, and saved persona snapshots on earlier user messages.
  • Retire global activation without rewriting stored personas: legacy active reads return null, and activation returns 410 without writes. Professor Mari no longer advertises global selection; DJ Mari no longer prioritizes its obsolete flag.
  • Update the persona guides, Noodle account-switcher explanation, and Unreleased changelog. Matching translations and removal of the obsolete UI key are in #6213.

Validation

  • pnpm check passes: localization, formatting, lint/types, E2E types, and production build.

  • pnpm regression:prompt passes, including prompt attachments and context fitting.

  • API regression reproduces the global fallback before the fix and passes afterward. It covers all modes, explicit/missing IDs, inert legacy reads, activation rejection without content/flag/timestamp changes, and preserved saved user identity after clearing the chat persona.

  • Client macro regression fails before and passes after, covering explicit/None/missing selections in every mode and character-backed identity precedence. Existing character-identity and client-cache regressions pass.

  • Focused browser flow passes 3/3: desktop Chromium (light), mobile Chromium (dark), and mobile WebKit (dark), using real local API storage and synthetic chats without provider calls. It verifies explicit Alice → Bob → None, historical persona snapshots, stale setup metadata, outgoing /send macros, and None after reload.

  • Final E2E types pass. A narrow WebKit repeat also passes after adding a screenshot animation-readiness assertion; the production code is unchanged.

  • pnpm check passes locally

  • Container (Docker / Podman) built and ran without issue

  • Ran the app, clicked through the changes manually

  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)

  • Above manual verification completed (describe below)

  • Read and followed CONTRIBUTING.md

Manual verification notes

Manually verify persona selection and None in existing Conversation, Roleplay, and Game chats on physical devices. Check message headers, user macros, and saved identities after switching personas. Local fixtures cover legacy active flags; a full user backup restore and paid model generation were not exercised.

Docs and release impact

English guides and CHANGELOG updated. All ten documentation language packs are aligned in #6213 on docs-i18n, together with #6211's command guides. Existing persona records and selected chat IDs are preserved. No migration, dependency, or version changes.

UI evidence

Before/after browser evidence contains a self-contained HTML file with the original desktop screenshots and settled mobile WebKit panel. Download the HTML to inspect it offline. Before captures reproduce the incorrect Conversation name and obsolete global controls; after captures show the corrected identity and simplified panel.

Summary by CodeRabbit

  • Changes
    • Persona selection is now managed per chat; chats no longer use a global active persona.
    • When no persona is selected, chat identity defaults to “User.”
    • Conversation macros now use the chat user identity rather than the message author.
    • Existing messages retain their recorded persona identity when personas change.
    • Persona panels and guides no longer show active/inactive status or activation controls.
    • Legacy global activation endpoints and commands are retired; persona selection remains available within individual chats.

🔄 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/6212 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 9/14/2026 **Status:** ✅ Merged **Merged:** 9/14/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `fix/persona-issue-sweep-6206` --- ### 📝 Commits (3) - [`ad56c61`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ad56c61c0e6610bb6be876fad907b18c0c8803d6) docs: track assigned persona issue sweep - [`cec53fb`](https://github.com/Pasta-Devs/Marinara-Engine/commit/cec53fb6e8db544436144d0fa27495acefb35404) fix: retire global active personas and align chat identity - [`4fa6f02`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4fa6f02160e5d358c2447bcfc918525bda3d9794) test: cover persona switching through desktop and mobile controls ### 📊 Changes **30 files changed** (+361 additions, -342 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+2 -0) 📝 `docs/characters/choosing-your-persona.md` (+7 -28) 📝 `docs/characters/personas.md` (+8 -14) 📝 `docs/noodle/overview.md` (+1 -1) 📝 `e2e/chat-sweep.e2e.ts` (+131 -0) 📝 `packages/client/src/components/characters/CharacterLibraryView.tsx` (+1 -21) 📝 `packages/client/src/components/chat/ChatArea.tsx` (+6 -23) 📝 `packages/client/src/components/chat/ConversationMessage.tsx` (+9 -3) 📝 `packages/client/src/components/panels/PersonasPanel.tsx` (+8 -54) 📝 `packages/client/src/components/panels/settings/TrackerCardColorSettings.tsx` (+1 -4) 📝 `packages/client/src/hooks/use-characters.ts` (+0 -26) 📝 `packages/client/src/lib/chat-macros.ts` (+8 -6) 📝 `packages/client/src/lib/persona-cache.ts` (+2 -19) 📝 `packages/client/src/localization/locales/en.json` (+0 -1) 📝 `packages/server/src/routes/characters.routes.ts` (+7 -14) 📝 `packages/server/src/routes/encounter.routes.ts` (+2 -9) 📝 `packages/server/src/routes/generate.routes.ts` (+1 -2) 📝 `packages/server/src/routes/generate/generate-route-utils.ts` (+2 -2) 📝 `packages/server/src/routes/scene.routes.ts` (+2 -4) 📝 `packages/server/src/services/chat-user-identity.ts` (+2 -1) _...and 10 more files_ </details> ### 📄 Description ## Linked issue Closes #6206 Closes #6207 Closes #6208 ## Why this change Choosing None in a Conversation chat still used the global active persona, even though the switcher reported no selection. The Roleplay composer and server also disagreed about that fallback. Following the maintainer's decision in #6206, global active personas are retired: each chat uses its selected persona, or remains anonymous. Conversation messages now resolve `{{user}}` from the user identity instead of the speaking character's label. ## What changed - Reuse the shared persona resolver for explicit chat selection in every mode. Remove implicit global fallback from rendering, composer macros, tracker color choices, and the obsolete setup-metadata UI fallback. - Remove the global activation button, Active/Inactive filters, badges, and unused active-persona hooks/cache handling. Existing persona library and chat selection controls remain available. - Correct Conversation display macros while preserving character headers, cosmetic display names, and saved persona snapshots on earlier user messages. - Retire global activation without rewriting stored personas: legacy active reads return null, and activation returns 410 without writes. Professor Mari no longer advertises global selection; DJ Mari no longer prioritizes its obsolete flag. - Update the persona guides, Noodle account-switcher explanation, and Unreleased changelog. Matching translations and removal of the obsolete UI key are in #6213. ## Validation - `pnpm check` passes: localization, formatting, lint/types, E2E types, and production build. - `pnpm regression:prompt` passes, including prompt attachments and context fitting. - API regression reproduces the global fallback before the fix and passes afterward. It covers all modes, explicit/missing IDs, inert legacy reads, activation rejection without content/flag/timestamp changes, and preserved saved user identity after clearing the chat persona. - Client macro regression fails before and passes after, covering explicit/None/missing selections in every mode and character-backed identity precedence. Existing character-identity and client-cache regressions pass. - Focused browser flow passes 3/3: desktop Chromium (light), mobile Chromium (dark), and mobile WebKit (dark), using real local API storage and synthetic chats without provider calls. It verifies explicit Alice → Bob → None, historical persona snapshots, stale setup metadata, outgoing `/send` macros, and None after reload. - Final E2E types pass. A narrow WebKit repeat also passes after adding a screenshot animation-readiness assertion; the production code is unchanged. - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` ### Manual verification notes Manually verify persona selection and None in existing Conversation, Roleplay, and Game chats on physical devices. Check message headers, user macros, and saved identities after switching personas. Local fixtures cover legacy active flags; a full user backup restore and paid model generation were not exercised. ## Docs and release impact English guides and CHANGELOG updated. All ten documentation language packs are aligned in #6213 on docs-i18n, together with #6211's command guides. Existing persona records and selected chat IDs are preserved. No migration, dependency, or version changes. ## UI evidence [Before/after browser evidence](https://gist.github.com/SpicyMarinara/99c74995a620923cdfc6311936dffefd) contains a self-contained HTML file with the original desktop screenshots and settled mobile WebKit panel. Download the HTML to inspect it offline. Before captures reproduce the incorrect Conversation name and obsolete global controls; after captures show the corrected identity and simplified panel. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Changes** - Persona selection is now managed per chat; chats no longer use a global active persona. - When no persona is selected, chat identity defaults to “User.” - Conversation macros now use the chat user identity rather than the message author. - Existing messages retain their recorded persona identity when personas change. - Persona panels and guides no longer show active/inactive status or activation controls. - Legacy global activation endpoints and commands are retired; persona selection remains available within individual chats. <!-- 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:16:27 +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#7091
No description provided.