mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #8780] [MERGED] fix: settings profiles keep Main and persona transitions; Model deletes, moves and Connection copies keep chat picks and review #8801
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#8801
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8780
Author: @SpicyMarinara
Created: 11/3/2026
Status: ✅ Merged
Merged: 11/4/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/settings-profiles-and-connections📝 Commits (9)
bf9d792fix(server): a duplicated Connection keeps its import review1385198fix(server): Model moves and removals hold chat metadata queues919cc16fix(server): applying a Model-less profile keeps the chat following Main14aa46afix(server): a profile persona switches identity like Chat Settings does8dcca07fix(client): deleting a Model refreshes chats instead of clearing their Model648aecbfix: quick setup keeps the picked persona when it applies a profile098b77afix(server): back-fill persona snapshots before the persona switch is saved6382772test(chats): pin the PATCH persona pairing to the row storage.update writes48a7a69Merge origin/staging into fix/settings-profiles-and-connections📊 Changes
14 files changed (+556 additions, -144 deletions)
View changed files
📝
packages/client/src/components/chat/ChatSetupWizard.tsx(+8 -20)📝
packages/client/src/hooks/use-chat-presets.ts(+11 -4)📝
packages/client/src/hooks/use-connections.ts(+6 -16)📝
packages/client/src/lib/chat-setup-draft.ts(+5 -1)📝
packages/server/src/routes/chat-presets.routes.ts(+13 -2)📝
packages/server/src/routes/chats.routes.ts(+63 -53)📝
packages/server/src/routes/connection-accounts.routes.ts(+9 -6)📝
packages/server/src/services/storage/chat-presets.storage.ts(+6 -2)📝
packages/server/src/services/storage/chats.storage.ts(+46 -38)📝
packages/server/src/services/storage/connections.storage.ts(+5 -2)📝
scripts/regressions/chat-create-keeps-main.regression.ts(+122 -0)📝
scripts/regressions/chat-profile-starting-picks.regression.ts(+145 -0)📝
scripts/regressions/connection-accounts-names-move-search.regression.ts(+12 -0)➕
scripts/regressions/connection-chat-pick-metadata-queue.regression.ts(+105 -0)📄 Description
Linked issue
Closes #8779
Why this change
A release-prep audit found four confirmed bugs, all new in this release (#8456, #8555), in settings profiles and Connections.
Review of the first fix found two more problems, also fixed here:
There is no linked issue; one should be opened before the PR is submitted.
What changed
Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Agent-run checks (for reference; each regression was shown to fail without its fix):
node ./scripts/pnpm-runner.mjs build:shared: Succeeded.node ./scripts/run-regressions.mjs --filter chat-create-keeps-main, with packages/client/src/hooks/use-connections.ts stashed back to the branch's previous comm: It failed without the fix: 'the chat keeps its pick on the Connection's other Model' (actual null). It passed with the fix.node ./scripts/run-regressions.mjs --filter chat-profile-starting-picks, with chat-presets.routes.ts and chat-presets.storage.ts stashed back to the branch's pr: It failed without the fix: 'the picked persona stays'. It passed with the fix.node ./scripts/run-regressions.mjs --filter for: issue-sweep-5371-5375, avatar-crop-contract, setup-wizard-survives-editor, onboarding-s1, open-issues, client-g: All passed: connection- 31/31, persona 7/7, profile-import 4/4, chat-profile 2/2, setup-wizard 2/2, every other filter 1/1. This includes every regression that reads the source of use-connections.ts,node ./scripts/run-regressions.mjs (full suite, run on the same file contents as the final commits): Regression summary: 1653/1653 passed; 0 failed; exit 0. One file, dottore-stream-progress.regression.mjs, failed on the first parallel run; the runner retried it on its own and it passed in 580ms. Itnode ./scripts/pnpm-runner.mjs --filter @marinara-engine/server lint (tsc -b ../shared && tsc --noEmit && tsc -p ../../scripts/regressions/tsconfig.character-ac: Passed with no errors.node ./scripts/pnpm-runner.mjs --filter @marinara-engine/client lint (eslint + tsc -p tsconfig.client-lanes.json): Exit 0: 0 errors and 12 warnings, all react-hooks/exhaustive-deps warnings in files I didn't touch. None are in ChatSetupWizard.tsx, use-connections.ts or use-chat-presets.ts.packages/client: node node_modules/typescript/bin/tsc -b: Exit 0.node_modules/.bin/prettier --write on all files changed in this round: Only chat-create-keeps-main.regression.ts was reformatted; the others were already formatted.pnpm localization:check: Not run, because no client copy changed.Independent adversarial review: changes, 2 issue(s), all addressed in a fix-up pass.
Known limits and risks:
Quick setup: picking a persona in quick setup on a chat that already has its greeting still adds one 'You are now playing as ' turn. That turn comes from the pick's own PATCH and happened on staging too. The extra turn for the profile's persona that the first fix added is gone, and so is the turn for the switch back that staging also added. Choosing a different profile in quick setup, without picking a persona, still adds a turn for that profile's persona if it differs from the chat's, the same as switching the persona there.
Quick setup now keeps a picked 'no persona' as well. Before, the switch back only happened when the picked persona or character was set, so picking none let the profile's persona win.
After a delete, useDeleteConnection now invalidates the chat list and every cached chat detail instead of patching the active chat. Every chat the delete touched now gets the server's result, as a Model move already did. The active chat shows it after the refetch, not straight away.
The PATCH rule that leaves followsMainModel alone when the id stays the same is kept for stale forms or tabs. The current client no longer sends that PATCH after a delete. A stale client that still sends {connectionId: null} to a chat whose pick moved to another Model would still drop the pick and follow Main. That is the old behaviour, and only from a stale client.
The PATCH persona backfill now runs after the chat row is updated instead of before. The snapshot is still built from the old row; the timing gap that moved is tiny.
Connection remove() and moveToAccount() (same-service moves included) now hold every chat's metadata queue for the transaction. This uses the same lock order lorebook deletion already used. A Model move or delete waits for any metadata patch in progress.
chat-presets.routes.ts imports recordChatIdentityChange from chats.routes.ts. I checked that this creates no import cycle.
Reviewer suggestion I changed: instead of sending the picked persona ids with the apply, the wizard sends keepPersona: true. The pick is already saved on the chat when the user makes it, so the server needs no second check of persona or character ids. The result is the same: the identity switches once and the apply records no change.
The Otome Hearth request relayed in this run (+5 affection instead of +20 for showing an outfit to a love interest) is not done. It is outside this worktree and these findings, and the otome-forge package lives in the separate Pasta-Devs/Marinara-Agents repo, so it needs its own task there.
Nothing was pushed and no PR was opened, as instructed.
Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.