[PR #6067] [MERGED] feat(chat): reassign historical persona attribution #7047

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/6067
Author: @Promansis
Created: 9/12/2026
Status: ✅ Merged
Merged: 9/12/2026
Merged by: @Promansis

Base: staging ← Head: feature(chat)/6043-reassign-historical-persona


📝 Commits (10+)

  • ec68b29 feat(chat): reassign historical persona attribution
  • 0d92884 fix(chat): harden historical persona reassignment #6043
  • 8427e3b Merge remote-tracking branch 'upstream/staging' into feature(chat)/6043-reassign-historical-persona
  • 8ee1fea fix(storage): serialize swipe extra patches #6043
  • be66986 fix(storage): serialize persona reassignment batch #6043
  • 50a44bc fix(storage): build persona backups from in-queue reads #6043
  • cb8ec43 Merge branch 'staging' into feature(chat)/6043-reassign-historical-persona
  • 8cf1351 fix(storage): recheck persona scope in batch #6043
  • f9088c2 Merge remote-tracking branch 'upstream/staging' into feature(chat)/6043-reassign-historical-persona
  • 5e7d0cd Merge remote-tracking branch 'origin/feature(chat)/6043-reassign-historical-persona' into feature(chat)/6043-reassign-historical-persona

📊 Changes

11 files changed (+554 additions, -14 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 packages/client/src/components/chat/ChatSettingsDrawer.tsx (+14 -0)
📝 packages/client/src/features/chat-settings/PickerDropdown.tsx (+14 -8)
➕ packages/client/src/features/chat-settings/sections/PersonaHistoryReassignDropdown.tsx (+160 -0)
📝 packages/client/src/hooks/use-chats.ts (+30 -0)
📝 packages/client/src/localization/locales/en.json (+12 -0)
📝 packages/server/src/routes/chats.routes.ts (+50 -0)
📝 packages/server/src/services/storage/chats.storage.ts (+222 -6)
📝 packages/shared/src/schemas/chat.schema.ts (+17 -0)
📝 packages/shared/src/types/chat.ts (+14 -0)
📝 scripts/regressions/prompt.regression.ts (+20 -0)

📄 Description

Linked issue

Closes #6043

Why this change

Changing the active persona currently leaves earlier user messages attributed to their historical identity. This adds an inline Chat Settings action to correct that attribution without rewriting message text or existing AI replies.

What changed

  • Added chat-scoped APIs and storage updates for historical persona snapshots, including every message swipe.
  • Added an inline Chat Settings dropdown using the persona or character currently selected in the chat.
  • Preserved source scopes for unassigned messages, a selected historical identity, or all user messages.
  • Added batched swipe loading, safe JSON preflight, compensating rollback, strict current-identity validation, and an in-queue scope recheck before writes.
  • Added localization, changelog coverage, and prompt regression coverage.

Validation

  • 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

Automated validation

  • pnpm check passed on final merged HEAD 5e7d0cd0cfb552a64649d12f1c69e8d85e2bdc5e.
  • pnpm regression:prompt passed all three suites on the same HEAD.
  • Launcher-update, release-tag, PR-triage, owner-approval, version-drift, installer-artifact, and whitespace checks passed.
  • The broader local security lane passed 11/13 cases. Two unrelated upstream sandbox probes fail deterministically on this host: extension-security.regression.ts reports parentSignalBlocked: false, and mari/db-execution-security.regression.ts reports EACCES while probing denied .env access. This branch does not change either area; hosted PR checks remain authoritative.
  • Marinara publish proof passed with base 09fa3eb77d1ebedd2cf0b871caf38970d0ed1c47, digest 14f040fe93bf05231a4b37b2fcc747acec7e7bdc65d1d16a39d17adb02ee2d20, and no missing required inputs.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

  • Manual UI screenshots or recordings are still required.

Summary by CodeRabbit

  • New Features
    • Added an “Apply persona to earlier messages…” action in Chat Settings.
    • Apply the selected persona to unassigned messages, messages attributed to a specific persona, or all user messages.
    • Added attribution summaries and confirmation, loading, success, and error feedback.
  • Improvements
    • Chat-setting pickers can optionally hide search controls for simpler selections.
  • Bug Fixes
    • Historical persona assignments now correctly affect speaker names in group conversations.

🔄 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/6067 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 9/12/2026 **Status:** ✅ Merged **Merged:** 9/12/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `staging` ← **Head:** `feature(chat)/6043-reassign-historical-persona` --- ### 📝 Commits (10+) - [`ec68b29`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ec68b295a7a49119e9415834e321de92ad3c2492) feat(chat): reassign historical persona attribution - [`0d92884`](https://github.com/Pasta-Devs/Marinara-Engine/commit/0d928846f3d4eecfbb1066b8940a43e2982f3874) fix(chat): harden historical persona reassignment #6043 - [`8427e3b`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8427e3bec0926a87e2029a433394a28d89cc9d7c) Merge remote-tracking branch 'upstream/staging' into feature(chat)/6043-reassign-historical-persona - [`8ee1fea`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8ee1fea426436c65fb10bc37f33de9374306eb4d) fix(storage): serialize swipe extra patches #6043 - [`be66986`](https://github.com/Pasta-Devs/Marinara-Engine/commit/be66986664a9adb8921d3d93d525f369b789418b) fix(storage): serialize persona reassignment batch #6043 - [`50a44bc`](https://github.com/Pasta-Devs/Marinara-Engine/commit/50a44bcaf09687368d4cff33cc591c432a0598b2) fix(storage): build persona backups from in-queue reads #6043 - [`cb8ec43`](https://github.com/Pasta-Devs/Marinara-Engine/commit/cb8ec434ed8c062acba691121087337e2582a37f) Merge branch 'staging' into feature(chat)/6043-reassign-historical-persona - [`8cf1351`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8cf1351141f5ace127135ac36f146cfdfee30ebc) fix(storage): recheck persona scope in batch #6043 - [`f9088c2`](https://github.com/Pasta-Devs/Marinara-Engine/commit/f9088c261f8f20ff13b99a418743809b5490430d) Merge remote-tracking branch 'upstream/staging' into feature(chat)/6043-reassign-historical-persona - [`5e7d0cd`](https://github.com/Pasta-Devs/Marinara-Engine/commit/5e7d0cd0cfb552a64649d12f1c69e8d85e2bdc5e) Merge remote-tracking branch 'origin/feature(chat)/6043-reassign-historical-persona' into feature(chat)/6043-reassign-historical-persona ### 📊 Changes **11 files changed** (+554 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `packages/client/src/components/chat/ChatSettingsDrawer.tsx` (+14 -0) 📝 `packages/client/src/features/chat-settings/PickerDropdown.tsx` (+14 -8) ➕ `packages/client/src/features/chat-settings/sections/PersonaHistoryReassignDropdown.tsx` (+160 -0) 📝 `packages/client/src/hooks/use-chats.ts` (+30 -0) 📝 `packages/client/src/localization/locales/en.json` (+12 -0) 📝 `packages/server/src/routes/chats.routes.ts` (+50 -0) 📝 `packages/server/src/services/storage/chats.storage.ts` (+222 -6) 📝 `packages/shared/src/schemas/chat.schema.ts` (+17 -0) 📝 `packages/shared/src/types/chat.ts` (+14 -0) 📝 `scripts/regressions/prompt.regression.ts` (+20 -0) </details> ### 📄 Description ## Linked issue Closes #6043 ## Why this change Changing the active persona currently leaves earlier user messages attributed to their historical identity. This adds an inline Chat Settings action to correct that attribution without rewriting message text or existing AI replies. ## What changed - Added chat-scoped APIs and storage updates for historical persona snapshots, including every message swipe. - Added an inline Chat Settings dropdown using the persona or character currently selected in the chat. - Preserved source scopes for unassigned messages, a selected historical identity, or all user messages. - Added batched swipe loading, safe JSON preflight, compensating rollback, strict current-identity validation, and an in-queue scope recheck before writes. - Added localization, changelog coverage, and prompt regression coverage. ## Validation - [ ] `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` ### Automated validation - `pnpm check` passed on final merged HEAD `5e7d0cd0cfb552a64649d12f1c69e8d85e2bdc5e`. - `pnpm regression:prompt` passed all three suites on the same HEAD. - Launcher-update, release-tag, PR-triage, owner-approval, version-drift, installer-artifact, and whitespace checks passed. - The broader local security lane passed 11/13 cases. Two unrelated upstream sandbox probes fail deterministically on this host: `extension-security.regression.ts` reports `parentSignalBlocked: false`, and `mari/db-execution-security.regression.ts` reports `EACCES` while probing denied `.env` access. This branch does not change either area; hosted PR checks remain authoritative. - Marinara publish proof passed with base `09fa3eb77d1ebedd2cf0b871caf38970d0ed1c47`, digest `14f040fe93bf05231a4b37b2fcc747acec7e7bdc65d1d16a39d17adb02ee2d20`, and no missing required inputs. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see `CONTRIBUTING.md § Translated documentation`) - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) - Manual UI screenshots or recordings are still required. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added an “Apply persona to earlier messages…” action in Chat Settings. - Apply the selected persona to unassigned messages, messages attributed to a specific persona, or all user messages. - Added attribution summaries and confirmation, loading, success, and error feedback. - **Improvements** - Chat-setting pickers can optionally hide search controls for simpler selections. - **Bug Fixes** - Historical persona assignments now correctly affect speaker names in group conversations. <!-- 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:03 +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#7047
No description provided.