mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #7422] [MERGED] feat(chat-profiles): ask to update other chats when saving a profile #7728
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#7728
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/7422
Author: @SpicyMarinara
Created: 10/11/2026
Status: ✅ Merged
Merged: 10/11/2026
Merged by: @SpicyMarinara
Base:
staging← Head:feat/profile-save-updates-chats📝 Commits (10+)
beb046bfeat(chat-profiles): ask to update other chats when saving a profilef88b69cfix(chat-profiles): load the chat list before counting profile followersd3e11a2fix(chat-profiles): keep each chat's own state when a profile updates other chats64dbea3fix(chat-profiles): count profile followers from a fresh chat list3384d02fix(chat-profiles): keep backgrounds and turned-off lorebooks in profiles, protect them only for other chats889064fMerge remote-tracking branch 'origin/staging' into feat/profile-save-updates-chats1ce0250fix(chat-profiles): update other chats from a list of Chat Settings onlyc320fdefix(chat-profiles): keep narrator-only commands and Noodle's permission per chatcdf969ffix(chat-profiles): update parameters only on the profile's connection and leave set-up agents per chatefa344adocs(chat-profiles): list what Save and update copies and what each chat keeps📊 Changes
11 files changed (+1090 additions, -22 deletions)
View changed files
📝
CHANGELOG.md(+1 -0)📝
docs/chats/chat-settings.md(+1 -1)📝
docs/chats/settings-profiles.md(+31 -1)📝
packages/client/src/components/chat/ChatSettingsDrawer.tsx(+50 -4)📝
packages/client/src/hooks/use-chat-presets.ts(+16 -0)📝
packages/client/src/localization/locales/en.json(+11 -0)📝
packages/server/src/routes/chat-presets.routes.ts(+15 -0)📝
packages/server/src/services/storage/chat-presets.storage.ts(+133 -14)📝
packages/shared/src/types/chat-preset.ts(+225 -1)📝
packages/shared/src/types/chat.ts(+1 -1)➕
scripts/regressions/chat-profile-followers.regression.ts(+606 -0)📄 Description
Linked issue
Closes #7409
Docs follow-up: #7423
Why this change
What changed
GET /chats, no retries), so chats changed in another window are included; if that request fails, it counts from the last loaded list at once. After an update, a toast says how many chats changed ("Updated 3 other chats"), and the affected chat queries are invalidated.CHAT_PROFILE_FOLLOWER_SYNC_KEYSinpackages/shared/src/types/chat-preset.tslists every key Save and update may change.applyToChat(…, { asFollower: true })first builds the metadata an apply by hand would write (system defaults, the profile, translator settings, the chat's preserved keys). It then starts from the follower's own metadata and gives each listed key that value (round 8). So a listed key the profile has no value for goes back to its default, exactly as picking the profile again does (the workaround #7409 describes): it is removed, or set to the default an apply writes (enableAgents: true,activeToolIds: [],chatSettingsHintDismissed: false, the app's translator defaults). Because Save always snapshots the saving chat's whole metadata first, "no value" means the saving chat uses the default. For translator settings that default is the app's translator default, as when picking the profile again; a saving chat made before those defaults were saved may still use the built-in ones (see Follow-ups). The exceptions an apply by hand already has carry over: a profile withoutwindowLayout,sceneVideoConnectionId,agentPromptTemplateIdsorcustomAgentImageSettingsleaves the chat's own.advancedMemorytakes the profile's settings while the follower keeps its ownknowledgeStarts,knowledgeConfirmedandnarratorCharacterId. Some keys copy only in part.chatParameters,imageCaptioningEnabledandimageCaptioningConnectionIdreach a follower only when its connection equals the profile'sconnectionId: Advanced Parameters are saved as differences from that connection's defaults, and image captioning without a value uses the chat's own connection's defaults (round 9).conversationSchedulesEnabledchanges only when the profile hastrueorfalse, because without a value schedules run whenever the chat's own characters have one, so removing a follower'sfalsewould turn its schedules back on (round 9).activeAgentIdstakes the profile's agents except Knowledge Retrieval, Knowledge Router, Lorebook Keeper and Expression Engine, which stay on or off as the follower has them, because their per-chat setup (knowledgeAgentSources,lorebookKeeperTargetLorebookId,spriteCharacterIds) is not copied.agentPromptTemplateIdstakes the profile's templates except for those four agents, whose templates stay the follower's (round 8). The resulting agent list can be empty; an empty list runs no agents, which matches the profile (round 8 removed a guard that assumed the opposite, and corrected theChatMetadata.activeAgentIdsdoc comment that said so). Translator settings are read throughnormalizeTranslatorSettings, so an older profile'stranslationTargetLang/translationPromptstill reach the follower as the input/output keys. The older namestranslationTargetLang,translationPromptandroleplayDmCommandsEnabledare listed too (round 9), so a follower's old value is removed with the new key instead of coming back as the fallback. Each chat keeps its own connection, prompt preset andupdatedAt, so background updates don't reorder Home's recent chats.FOLLOWER_OWN_METADATA_KEYSis removed; nothing needs it any more.POST /api/chat-presets/:id/apply-to-followers, body{ exceptChatId }, returns{ updated, chatIds, failed }. It reusesapplyToChatthrough theasFolloweroption, so the per-chat metadata queue, mode check and translator handling are shared. Inside each chat's queue,asFollowerchecks the fresh metadata again and skips a chat that left the profile after the scan. It never writesconnectionId,promptPresetIdorupdatedAt. The route returns 400 for the Default profile, which can't be saved into, and 404 for an unknown profile. Each chat is updated in its owntry, so one failure (logged with Pinowarn) does not stop the rest or lose the list of chats already changed. It logs one Pinoinfoline with the counts.chatFollowsChatPreset(metadata, presetId)inpackages/shared/src/types/chat-preset.tsdecides which chats follow a profile. The dialog count (client) and the update (server) both use it, so the two can't drift.metadata.multiplayer(hosted or joined) ormultiplayerSetup === trueis never updated. That is the same testChatAreauses to hide Chat Settings in rooms, and the server's presence code uses it too. Why updating them would be unsafe:multiplayer/service.ts). Updating it from the profile would turn those back on in a shared session.multiplayerkey, because it wasn't preserved.CHAT_PRESET_EXCLUDED_METADATA_KEYS, plus PixelForge's two keys in a newCHAT_PRESET_EXCLUDED_PACKAGE_METADATA_KEYS(see the table). The storage layer also excludes anymultiplayer*key by prefix, the same ruleprotectRoomMetadatauses. Excluded keys are also preserved on apply, so applying a profile now keeps the target chat's own copy instead of wiping it.advancedMemorystays a profile setting, but its per-chat valuesknowledgeStarts,knowledgeConfirmedandnarratorCharacterIdare left out of the profile, and applying a profile keeps the target chat's own values. These are message and character ids from one chat;remapAdvancedMemoryMetadataand the chat wizard already treat them that way.docs/chats/settings-profiles.md(the "Updating other chats that use the profile" subsection lists which kinds of settings Save and update copies and what each chat keeps, says a setting left at its default in the saving chat goes back to its default in the others, then says Advanced Parameters and image captioning change only on the profile's connection, character schedules change only when the saving chat has them turned on or off, and the four set-up agents stay, with their prompt templates, as each chat has them) anddocs/chats/chat-settings.md(one sentence on the Save icon).[Unreleased].scripts/regressions/chat-profile-followers.regression.ts.The follower allowlist (
CHAT_PROFILE_FOLLOWER_SYNC_KEYS)Built by enumerating every chat-metadata write in
ChatSettingsDrawer.tsxand what it renders (thefeatures/chat-settings/sections/*sections,RoleplayCommandsSettings,StoryboardChatSettingsPanel,AgentAddSetupFields'buildAgentAddMetadataPatch,AdvancedMemorySettingsthrough its server action, and the Calls and Long-term memory package settings, which write through the drawer'supdateMetadata/onChatSettingsChangecallbacks; their keys were checked in the local Marinara-Agents checkout). A key is listed only if it is a setting that should match across the chats using one profile. Each entry has a short comment in the code.chatParameters(Advanced Parameters overrides; only for followers on the profile's connection),contextMessageLimit,excludePastReasoning,pastReasoningLimit,lorebookTokenBudget,imageCaptioningEnabled,imageCaptioningConnectionId(both only for followers on the profile's connection),imageCaptioningPrompt,enableTools,forceToolCall,activeToolIds,cardCssMode,scopedRegexModegroupChatMode(merged or individual),groupResponseOrder,groupTurnPromptEnabled,groupSpeakerColors,groupSpeakerNamesInHistorycrossChatAwareness,autonomousMessages,autonomousDailyCapOverride,characterExchanges,conversationSchedulesEnabled(only when the profile has a value),characterCommands,conversationCommandToggles,imageGenConnectionId(selfie connection),selfieResolution,selfieUseAvatarReferences,selfieIncludeCharacterAppearance,conversationCallsEnabled,conversationCallVoiceCues,conversationCallSummaryConnectionId(Calls package settings),slurp2ActivityContextEnabledroleplayCommandsEnabled,roleplayDmCommandsEnabled(older DM switch),roleplayCommandToggles,roleplaySoundConnectionIdenableAgents,activeAgentIds(except the four agents each chat sets up),agentPromptTemplateIds(except the same four agents),customAgentImageSettings,agentWriteApprovalRequired,attachSummariesToAgents,attachLorebooksToTrackers,manualTrackers,manualTrackerAgentTypesillustratorImageConnectionId,illustratorPromptConnectionId,illustratorIncludeCharacterAppearance,illustratorUseAvatarReferences,illustratorAutoBackgroundsEnabled,illustratorImagesPerGeneration,illustratorRunInterval,sceneVideoConnectionId(Scene videos connection, round 6),imageStyleProfileId,narrativeDirectorSecretPlotEnabled,narrativeDirectorSecretPlotRunIntervalproseGuardianBannedWords,proseGuardianAvoidInstructions,proseGuardianStyleInstructions,proseGuardianHoldForRewrite,lorebookKeeperReadBehindMessagescustomMusicFolder,spotifySourceType,spotifyPlaylistId,spotifyPlaylistName,spotifyArtist,enableHapticFeedback,hapticSensitivity,hapticIncidentalContact,hapticIntifaceUrlspriteDisplayModes,spritePosition,spriteScale,spriteOpacity,expressionSpriteScale,fullBodySpriteScale,expressionSpriteOpacity,fullBodySpriteOpacity,expressionOnlyActiveSprites,expressionAvatarsEnabledstoryboardAgentImageAwareShotPlanningEnabled,storyboardAgentAnimationRefinementTemplateId,roleplayStoryboardAutoGenerateMode,roleplayStoryboardRunInterval,roleplayStoryboardKeyframeCount,roleplayStoryboardAnimationDurationSeconds,roleplayStoryboardPromptConnectionId,roleplayStoryboardImageConnectionId,roleplayStoryboardVideoConnectionId,roleplayStoryboardEpisodeTemplateId,roleplayStoryboardStyleTemplateId,roleplayStoryboardAnimationTemplateId,roleplayStoryboardOutputTemplateId,roleplayStoryboardIncludeCharacterAppearance,roleplayStoryboardUseAvatarReferences,roleplayStoryboardUseNovelAiCharacterPrompts,roleplayStoryboardUsePromptTemplate,roleplayStoryboardImagePromptTemplateId,roleplayStoryboardVideoPromptTemplateIdlongTermMemoryRecallStyle,longTermMemoryBudgetTokens,longTermMemoryMaxChunksenableMemoryRecall,advancedMemory(settings only; anchors stay with the chat),summaryConnectionId,summaryMaxTokens,summaryTailMessages,dayRolloverHour,semanticSummaryRetrievalEnabled,semanticSummaryRecentCount,semanticSummaryOlderCount,semanticSummaryMinSimilaritytranslationProvider,translationConnectionId,translationTargetLang(older shared language),translationInputTargetLang,translationOutputTargetLang,translationDeeplApiKey,translationDeeplxUrl,translationPrompt(older shared prompt),translationInputPrompt,translationOutputPrompt,autoTranslate,translateInput,showInputTranslateButton,translationDisplayOnlywindowLayout(window and button layout; the Save snapshot already captures it on purpose),chatSettingsHintDismissed129 keys (round 6: four narrator-only audiences and the Noodle permission removed,
sceneVideoConnectionIdadded; round 9: the three older names added). A sanity check confirmed none is in the profile exclusion lists or under themultiplayer*prefix, and the onlyscene*key,sceneVideoConnectionId, is exempted from that prefix (a key that profiles drop would never reach a follower).Written by Chat Settings but deliberately not listed (each follower keeps its own):
inactiveCharacterIds,spriteCharacterIds,spritePlacements,spriteCharacterVisualSettings,roleplayCommandNarratorId,activeLorebookIds,excludedLorebookIds,knowledgeAgentSources,lorebookKeeperTargetLorebookId,presetChoices,macroVariables,branchName.customSystemPrompt(pairs with the prompt preset the follower keeps),groupScenarioText,sceneSystemPrompt.roleplayRollAudience,roleplayDocumentAudience,roleplayWhisperAudience,roleplayCombatAudience. The value"narrator"only works together with the chat's ownroleplayCommandNarratorId(isRoleplayCommandAllowed), which is cast and not copied. Copying it to a chat without that narrator, such as a 1:1 chat, turned those commands off for every character there.noodleTimelineContextEnabled(round 6): "Timeline refreshes may include recent messages from this chat". It is a per-chat permission to share that chat's messages, so each chat gives it itself, the same reason asdiscordWebhookUrlbelow.discordWebhookUrl: judgement call. It is the Discord channel this chat's messages are posted to; copying it would send another chat's messages to that channel. Maintainer: say if it should be listed.game*,enableSpriteGeneration): Game Mode has no settings profiles (CHAT_SETTINGS_SURFACES.game.showSettingsProfilesis false).Profile settings changed outside Chat Settings, so not listed (each follower keeps its own; maintainer may want some added): the Chat Summary popover's
automaticSummaryEnabled,summaryRunInterval,summaryContextSizeandhideSummarisedMessages(the last also needs #7426 first), Appearance'sroleplayDisplayStyle, and the globalconversationTimeZone(written to every Conversation chat at once). The legacyagentOverridesmap has no writer any more.Keys excluded from profiles, and why
multiplayerMultiplayerStoredRoom/MultiplayerJoinedRoom(room id, epoch, participants, receipts)multiplayerSetup,multiplayerSetupComplete,multiplayerGameSetupMultiplayerChatwhile preparing one roommultiplayerCharacterMemories,multiplayerGameAppliedMessages,multiplayerGameTurnallowRoomKeysby room runtimeadvancedMemoryStatemacroVariables{{setvar}}values persisted per chatagentVariablesinactiveCharacterIdsintentCooldownsautonomousDailyBudgetautonomousDailyCapOverrideis a setting and staysconversationCharacterStatusesconversationStatusOverridesconversationAboutMeOverridesconversationAboutMeInjectis a setting and staysadvancedMemoryRosterChangeschats.routes.ts,advanced-memory-transfer.ts)encounterActivearchivedCharacterSnapshotsChatAreafor their old messagesconversationSummaryFailuresconversation-history-runtime.ts)spriteExpressionsChatArea)roleplayDmThread,dmOriginChatId,dmOriginChatName,dmOriginMessageId,dmSourceUserMessageId,dmTargetCharacterIdroleplay-dm-command-runtime.ts)decisionTimers(new)DECISION_TIMERS_METADATA_KEY, sticky/cooldown/every state per Decision statement (decision-timers.ts)spatialSharedWorldLink(new)SPATIAL_SHARED_WORLD_LINK_METADATA_KEY)spatialContexttrackerFeaturedCharacterKeys(new)TRACKER_FEATURED_CHARACTER_META_KEY, the characters featured in this chat's Tracker PanelconversationSetupComplete(new)pixelforge,pixelforgeCorruptExcerpt(new,CHAT_PRESET_EXCLUDED_PACKAGE_METADATA_KEYS)packages/pixelforge)CHAT_PRESET_EXCLUDED_METADATA_KEYSalso feedsENGINE_OWNED_METADATA_KEY_PREFIXES' derivation, andcapability-gm-verbswould then reserve thepixelforgenamespace from the PixelForge package itselfThe scoping list named
conversationCharacterStatusOverridesandconversationCharacterAboutMeOverrides. No such keys exist; the real keys areconversationStatusOverridesandconversationAboutMeOverrides, and those are what this PR excludes.Side effect on the chat wizard:
captureChatWizardDefaultsreusesCHAT_PRESET_EXCLUDED_METADATA_KEYS, so wizard defaults now leave out these running-state keys too, including the newdecisionTimers,spatialSharedWorldLinkandtrackerFeaturedCharacterKeys(conversationSetupCompletewas already out). It does not read the new package list, so PixelForge's keys in wizard defaults behave as on staging. Wizard defaults still capturebackgroundandexcludedLorebookIds, as on staging (chat-wizard-defaults.tsis unchanged from staging).Explicit apply and Save compared with staging
Every difference for Save into this profile, applying a profile from the dropdown, a starred profile on a new chat, the wizard's Use a Profile, and applying Default (including after deleting the applied profile):
multiplayerkey.inactiveCharacterIds,conversationStatusOverrides,conversationAboutMeOverridesare user-editable as well as written by the server (the character-activity agent, the card's status overrides, the about-me tool), so they are not pure runtime state. They stay excluded because they are keyed by this chat's own characters, which a profile never carries. Maintainer: please confirm.knowledgeStarts,knowledgeConfirmed,narratorCharacterIdare no longer saved, and an apply keeps the target's own. They are this chat's message and character ids.sceneVideoConnectionId(round 6), the Illustrator's Scene videos connection, is now saved into profiles. On staging thescene*prefix rule dropped it, so profiles never held it. An explicit apply now sets it when the profile has one. A profile without one (every profile saved before this change, and Default) leaves the chat's own value, as on staging; this is the same rulewindowLayoutalready uses.authorNotes/authorNotesDepth(user text: saved, and set by an explicit apply),background,excludedLorebookIds,customSystemPrompt,roleplayCommandNarratorId,lorebookKeeperTargetLorebookId,knowledgeAgentSources,hideSummarisedMessages, the connection and prompt preset, andupdatedAt. As on staging, a profile without a background clears the chat's background on apply, and applying Default resets it. Followers are protected from all of these by the allowlist.Validation
pnpm checkpasses locallyCONTRIBUTING.mdCommands the agent ran locally (results are the agent's, not a human check):
Round 9 (head
f5c5303ce):pnpm check: exit 0. One existing lint warning inHomeProfessorMariChat.tsx, which this PR doesn't touch.pnpm localization:check: exit 0.chat-profile-followerspasses. New checks: a follower on another connection keeps its ownimageCaptioningEnabled: falseandimageCaptioningConnectionId, also when the profile hasimageCaptioningEnabled: true; on the profile's connection it getstrue, and its captioning connection, which the profile leaves to the connection, is removed as an apply by hand does; a Conversation follower withconversationSchedulesEnabled: falsekeeps it when the profile has no value, a follower without one gets none, and a profile withtruegivestrueto both; a follower'sroleplayDmCommandsEnabled,translationTargetLangandtranslationPromptare removed, DM commands stay off and the input language isen, as in the saving chat; a profile withoutcustomAgentImageSettingsleaves the chat's own. The "Save and update and applying agree" loop now also covers the three older names.chat-preset.tsandchat-presets.storage.tsatfa5577950it fails at "the follower's own roleplayDmCommandsEnabled goes back to the default the saving chat uses"; with onlychat-presets.storage.tsatfa5577950it fails at "a follower on another connection keeps its own image captioning". Mutations, each run alone and then restored: gating onlychatParametersfails at "a follower on another connection keeps its own image captioning"; skipping captioning on the profile's connection too fails at "and the same image captioning"; removing the schedule rule fails at "a profile with no schedule choice leaves a chat's schedules off"; always keeping the follower's schedules fails at "the profile's schedule choice"; removingroleplayDmCommandsEnabled,translationTargetLangortranslationPromptfrom the list fails at "the follower's own goes back to the default the saving chat uses"; removing thecustomAgentImageSettingspreservation fails at "and so does a profile without custom agent image settings".chat-settings-hint,chat-variables-preset-precedence,profile-import-asset-security,profile-import-data-security,profile-import-noodle,chat-window-defaults,chat-wizard-defaults,roleplay-commands,illustrator-message-range,--filter multiplayer(13 files),--filter conversation(4 files),--filter translat(1 file),--filter caption(1 file),pnpm regression:prompt(3 files).Round 8 (head
fa5577950):pnpm check: exit 0. One existing lint warning inHomeProfessorMariChat.tsx, which this PR doesn't touch.pnpm localization:check: exit 0.chat-profile-followerspasses. Changed and new checks: a follower'ssummaryMaxTokensandtranslationDisplayOnly, which the saving chat never set, are removed (they were asserted as kept before, the behaviour this round fixes); the follower gets the app's translator defaulttranslateInput: true; for every key inCHAT_PROFILE_FOLLOWER_SYNC_KEYSexcept the two agent keys, Save and update and a later apply by hand give the same value; the follower keeps its own prompt templates forlorebook-keeperandexpression, gets the profile's for other agents and not the source'sknowledge-retrievaltemplate; a profile whose only agent isknowledge-retrievalturns a["director"]chat to[](it asserted["director"]before, the wrong result this round fixes) and still leaves["expression"]in a["director", "expression"]chat; that chat's owncontextMessageLimitis removed while itswindowLayout,sceneVideoConnectionIdand prompt templates stay, because the profile has none; explicit apply keeps the target's Advanced Memory anchors; an unlistedmultiplayerFutureStatekey stays out of profiles and is kept by both paths.chat-presets.storage.tsatefa344a93, it fails at "the follower gets the profile's prompt templates but keeps its own for agents that need setup". Mutations of the new code, each run alone and then restored: removingelse delete next[key]fails at "the follower's own summaryMaxTokens goes back to the default the saving chat uses"; putting the empty-list guard back fails at "Director is off, as in the profile"; dropping the follower's set-up agent templates fails at the prompt-template check; building the follower update without the system defaults fails at "the follower gets the app's translator default"; removing themultiplayer*prefix rule fails at "saving a profile leaves out the chat's own multiplayerFutureState"; disabling the explicit-apply Advanced Memory anchor preservation fails at the anchor checks; disabling thewindowLayout/sceneVideoConnectionIdrule fails at "a profile saved without a video connection leaves the chat's own".chat-settings-hint,chat-variables-preset-precedence,profile-import-asset-security,profile-import-data-security,profile-import-noodle,chat-window-defaults,chat-wizard-defaults,roleplay-commands,illustrator-message-range,--filter multiplayer(13 files),--filter conversation(4 files),pnpm regression:prompt(3 files).Round 7 (head
efa344a93):pnpm check: exit 0. One existing lint warning inHomeProfessorMariChat.tsx, which this PR doesn't touch.pnpm localization:check: exit 0.chat-profile-followerspasses. New checks: the profile saveschatParameters(with an OpenRoutercustomParameters.providerobject) and every agent; a follower on another connection keeps its ownchatParameters; after switching it to the profile's connection it gets the profile's; the follower gets the profile's plain agents but keeps its ownlorebook-keeperandknowledge-routerand does not getknowledge-retrievalorexpression; explicit apply still sets the profile'schatParametersand full agent list; a profile whose only agent isknowledge-retrievalleaves a["director"]chat's list alone (no empty list) and turnsdirectoroff but keepsexpressionin a["director", "expression"]chat.chat-presets.storage.tsatc320fde07(new regression), it fails at "a follower on another connection keeps its own Advanced Parameters".chat-settings-hint,chat-variables-preset-precedence,profile-import-asset-security,profile-import-data-security,profile-import-noodle,--filter multiplayer(13 files),--filter conversation(4 files),pnpm regression:prompt(3 files).Round 6 (head
c320fde07):pnpm check: exit 0. One existing lint warning inHomeProfessorMariChat.tsx, which this PR doesn't touch.pnpm localization:check: exit 0.chat-profile-followerspasses. New checks: the profile saves every shared setting, includingsceneVideoConnectionId; a follower getssceneVideoConnectionId; a follower keeps its own four audiences andnoodleTimelineContextEnabled;isRoleplayCommandAllowedstays true for roll, document and whisper on a follower whose character is not the source's narrator; a Conversation follower without these keys gets none; explicit apply setssceneVideoConnectionId; an older profile without it leaves the chat's own.chat-preset.tsandchat-presets.storage.tsat1ce025077(new regression), it fails at "the profile saves sceneVideoConnectionId". A soft-assert copy (temporary, deleted) showed every new case failing there: the video connection not saved, not copied and not kept on apply; the four audiences and the Noodle permission overwritten on the follower and given to a Conversation follower that had none; roll, document and whisper turned off for the follower's character.chat-window-defaults,chat-settings-hint,chat-wizard-defaults,experience-state-ordinal,chat-variables-preset-precedence,sprite-background,group-narration-mode-sync,capability-package-chat-controls,open-issues,capability-gm-verbs,game-inventory-turn,spatial-location-reference,roleplay-commands,roleplay-function-calling,--filter multiplayer(13 files),--filter advanced-memory(16 files),--filter conversation(4 files),pnpm regression:prompt(3 files).Round 5 (allowlist, head
1ce025077):pnpm check: exit 0. One existing lint warning inHomeProfessorMariChat.tsx, which this PR doesn't touch.pnpm localization:check: exit 0.chat-profile-followerspasses. It now checks that a follower receives listed keys (contextMessageLimit,chatParameters,activeAgentIds,roleplayCommandToggles,summaryConnectionId,translationProvider,windowLayout,enableAgents,advancedMemory); that its other keys stay and are never deleted, including an unknownsomeFuturePackageState,decisionTimers,authorNotes,authorNotesDepth,background,excludedLorebookIds,pixelforge,spatialSharedWorldLink,roleplayDisplayStyleandimpersonatePrompt; that listed keys missing from the profile (summaryMaxTokens,translationDisplayOnly) keep the follower's value; that explicit apply still setsauthorNotes,backgroundand the other chat choices and keeps every running-state key; and that the six new runtime keys are not saved into profiles.chat-preset.tsandchat-presets.storage.tsat889064ff3(regression unchanged), it fails at "saving a profile leaves out the chat's own decisionTimers". A soft-assert copy of the regression (temporary, deleted) listed every failing case on889064ff3: the six new keys saved into the profile, overwritten on the follower and lost on explicit apply; the follower'sauthorNotes,authorNotesDepthandsomeFuturePackageStateoverwritten;roleplayDisplayStyle,impersonatePrompt,summaryMaxTokensandtranslationDisplayOnlydeleted from the follower; a follower withoutauthorNotes/someFuturePackageStategiven the profile's; the Conversation follower's ownsomeFuturePackageStateand Author's Note replaced.chat-window-defaults,chat-settings-hint,chat-wizard-defaults,experience-state-ordinal,chat-variables-preset-precedence,sprite-background,group-narration-mode-sync,capability-package-chat-controls,open-issues,capability-gm-verbs,game-inventory-turn,spatial-location-reference,--filter multiplayer(13 files),--filter advanced-memory(16 files),--filter conversation(4 files),pnpm regression:prompt(3 files).capability-gm-verbsfailed with PixelForge's keys inCHAT_PRESET_EXCLUDED_METADATA_KEYS("new engine metadata namespaces are not in ENGINE_OWNED_METADATA_KEY_PREFIXES: pixelforge"); hence the separate package list.Round 4 (head
889064ff3, after merging origin/stagingecd62a2e4):pnpm checkandpnpm localization:checkexit 0;chat-profile-followersand the same related regressions passed.Earlier rounds:
chat-profile-followersfailed on origin/staging code and on each earlier head for the fix that round added; related regressions passed (chat-window-defaults,chat-settings-hint,chat-wizard-defaults,experience-state-ordinal,open-issues,capability-gm-verbs,game-inventory-turn,group-narration-mode-sync,context-message-limit-modes,capability-package-chat-controls,capability-package-lifecycle,agent-activity-status,avatar-crop-contract,chat-window-icons,floating-window,memory-nag-onboarding,roleplay-streaming,tracker-gallery-ui,chat-branch-lineage,sprite-background,--filter multiplayer,--filter conversation,--filter advanced-memory,pnpm regression:prompt).Manual verification notes
{{setvar}}macro variables and a disabled group member: applying a profile keeps both, and a profile saved from that chat no longer carries them to another chat.GET /api/chatsin the browser's dev tools): Save responds at once instead of waiting.providerrouting object in the OpenRouter chat, then Save and update. The other chat keeps its own Advanced Parameters and still generates.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)Docs touched:
docs/chats/settings-profiles.md,docs/chats/chat-settings.md,CHANGELOG.md. Docs follow-up: #7423 (comments with the round 5, 6, 7 and 9 wording added).UI evidence (if applicable)
Local CodeRabbit review
coderabbit review --agent --committed --base-commit $(git merge-base HEAD origin/staging).Round 9 (head
f5c5303ce): 4 minor findings, all rejectedNone is about this round's change (
chat-presets.storage.ts,chat-preset.ts, the regression); all repeat earlier rounds.docs-i18n, or link a follow-up issue" (minor,docs/chats/chat-settings.md). #7423 is that follow-up, linked above; this round's changed paragraph ofsettings-profiles.mdis added there as a comment. The local CLI can't see the PR body or issues.ChatSettingsDrawer.tsx, reported twice). The same point as rounds 5, 6 and 8.openDialoginlib/app-dialogs.tsresolves a dialog that is still open with its fallback (nullfor a choice dialog) before opening the next, so of two overlapping flows with other chats only the last confirmed one saves, and a second Save and update needs a second confirmation. Without other chats there is no dialog, and two quick clicks save the same snapshot twice, as staging's unguarded Save already does; both writes give the same result, and the follower update is idempotent.GET /chatsfails instead of counting the loaded list" (minor,ChatSettingsDrawer.tsx). The same point as rounds 7 and 8 and earlier runs 2 to 4. On staging, saving a profile never depended on the chat list, and blocking it on a separate request would be a regression. A stale fallback can only under-count, so the worst case is that the dialog is skipped and Save behaves like staging's Save; no chat is changed without asking.No code changed after this run, so it was not repeated.
Round 8 (head
fa5577950): 3 minor findings, all rejecteddocs-i18n, or link a follow-up issue" (minor,docs/chats/settings-profiles.md). #7423 is that follow-up, linked above. This round's two changed sentences are added there as a comment. The local CLI can't see the PR body or issues.ChatSettingsDrawer.tsx). The same point as rounds 5 and 6.openDialoginlib/app-dialogs.tsresolves a dialog that is still open with its fallback (nullfor a choice dialog) before opening the next, so two overlapping clicks need two confirmations. Two confirmed updates are safe: each chat is updated inside its ownwithChatMetadataPatchQueue,applyToChatreads the profile again inside that queue, and the update is idempotent (the same profile gives each chat the same values), so the last save wins. Staging's Save button has no pending guard either.ChatSettingsDrawer.tsx). The same point as round 7, item 4. The count comes from a freshGET /chats; only a failed request falls back to the loaded list. A stale fallback can only under-count, so the worst case is that the dialog is skipped and Save behaves like staging's Save. No chat is changed without asking.No code changed after this run, so it was not repeated.
Round 7 (head
cdf969f42): 6 findings, 2 fixed (one docs fix, reported twice), 4 rejecteddocs/chats/settings-profiles.md, reported twice). This round made the bullet longer. Same words, now two short lists ("copies" and "stays as each chat has it") and one paragraph for the two exceptions (efa344a93). Docs only, so CodeRabbit was not run again.translationDeeplApiKeyto followers" (minor,chat-preset.ts). There is no per-chat key contract.translationDeeplApiKeyis one ofTRANSLATOR_SETTINGS_KEYS, whichnormalizeTranslatorSettingscalls "reusable translator settings"; the global translator defaults store it, Save puts it into the profile, and an explicit apply sets it on staging. Copying it keeps chats on one profile using the same translator.GET /chatshides home Professor Mari chats" (minor,ChatSettingsDrawer.tsx). A home Professor Mari chat never follows a profile:/internal/professor-maricreates it throughstorage.createpluspatchMetadatawith noappliedChatPresetId, and none of the callers ofuseApplyChatPreset(ChatSetupWizard,ChatSettingsDrawer,NewChatConnectionGate,ChatSidebar,use-start-chat-from-character,use-start-new-chat-mode) is reachable for it. So the client count and the server scan agree.ChatSettingsDrawer.tsx). Round 4 chose oneGET /chatswith the loaded list as the fallback on purpose (see Round 4, item 5). A stale fallback can only under-count, so the worst case is that the dialog is skipped and Save behaves like staging's Save; no chat is changed without asking.docs-i18nor link a follow-up" (minor,docs/chats/chat-settings.md). #7423 is that follow-up, linked above, with this round's wording added as a comment.Round 6 (head
c320fde07): 2 minor findings, both rejectedThe same two findings as round 5, for the same reasons:
docs-i18n, or link a follow-up issue" (minor,docs/chats/chat-settings.md). #7423 is that follow-up, linked above, with this round's wording added as a comment. The local CLI can't see the PR body.ChatSettingsDrawer.tsx). Checked again inlib/app-dialogs.ts:openDialogresolves a dialog that is still open with its fallback (nullfor a choice dialog) before opening the next, so of two overlapping flows only the last confirmed one saves. A click while the save is running opens a new dialog and needs a new confirmation. Without other chats, two clicks save the same snapshot twice, as staging's Save already does, and both writes give the same result.No code changed after this run, so it was not repeated.
Round 5 (head
1ce025077): 2 minor findings, both rejecteddocs/chats/settings-profiles.md). The follow-up exists: #7423,[docs-i18n] docs/chats/settings-profiles.md, docs/chats/chat-settings.md, linked above as "Docs follow-up: #7423" and updated with this round's wording. The local CLI can't see the PR body or issues, so it raises this every round.ChatSettingsDrawer.tsx). Overlapping Save flows can't both reach the follower update:openDialoginlib/app-dialogs.tsresolves any dialog still open with its fallback (nullfor a choice dialog) when a new one opens, so the earlier flow returns without saving and only the last confirmed choice saves. A second Save and update therefore needs a second confirmation. Without other chats there is no dialog, and two quick clicks save the same snapshot twice, as staging's Save button (also unguarded) already does. Both writes are idempotent: the same profile gives each follower the same values.No code changed after this run, so it was not repeated.
Earlier rounds
coderabbit review --agent --committed --base-commit $(git merge-base HEAD origin/staging), run four times. Runs 1 and 2 had one minor finding each, run 3 had four (one major, three minor), and run 4 had one minor finding.Run 1, fixed in
f88b69c99. If the chat list had not loaded yet,allChats ?? []counted no followers, so Save skipped the choice. Save now loads the list first withrefetch()before counting.Run 2, not changed (rejected). CodeRabbit suggested aborting the save with an error when that refetch fails. Reason for rejecting: on staging, saving a profile never depended on the chat list. When the list can't load, falling back to "no followers" keeps Save working exactly as it does on staging. Blocking a working profile save on a separate list request would be a regression. The refetch already uses
useChats' retry policy (up to 10 attempts), so missing data means the server is not answering, and the follower update would fail too. Nothing is silently lost: the profile is saved, and the other chats keep their copy, as before.Run 3, fixed in
64dbea394(one major, one minor; the same point twice). Save counted from the cached chat list, so a chat that started using the profile in another window could be missed or miscounted. Save now always refetches the list before counting.Run 3, not changed (rejected, two minor). (a) It said a rejected
refetchAllChats()would throw before the save'stry. React Query'srefetch()doesn't reject by default (throwOnErroris false); it resolves with an error result, so nothing throws there. (b) It again suggested stopping the save when the refresh fails. Rejected for the run 2 reason. Also, a failed refetch keeps the last loadeddata, so the count falls back to the cached list, and to zero only if the list never loaded at all.Run 4, not changed (rejected, minor). The same "stop the save if the follower list cannot refresh" suggestion, for the same reasons as runs 2 and 3(b).
Run 5 (head
889064ff3), no findings. Reviewed all 10 changed files.Note on 3(b): the claim that a failed refetch falls back quickly was wrong;
refetch()ranuseChats' 10-retry policy first (about 40 s). Round 4 replaced it with a single request (see below).Review threads
Round 5 replied to and resolved the three open threads: the docs-i18n one (points to #7423) and the two PixelForge ones (
pixelforgeandpixelforgeCorruptExcerptare now excluded from profiles, and the allowlist keeps package state off other chats anyway).Adversarial review
Round 9 (head
fa5577950)Fixed in
f5c5303ce(syncFollowerMetadatainchat-presets.storage.ts, the list inchat-preset.ts):imageCaptioningEnabled/imageCaptioningConnectionIdremoved the follower's own values, so it used its own connection's captioning defaults (resolveImageCaptioningRuntime,AdvancedParametersSection), matching neither the saving chat nor an apply by hand, which also moves the chat to the profile's connection. Both keys now follow thechatParametersrule: they change only in chats on the profile's connection, where removing them gives the same connection defaults the saving chat uses. On another connection the follower keeps its own, also when the profile has a value, because an explicit "off" from a vision model's chat would send another chat's images to a text-only model raw.conversationSchedulesEnabledturned a follower's switched-off schedules back on. Without a value, schedules run whenever the chat's characters have one (areConversationSchedulesEnabledis!== false), and Chat Settings shows them off only when nothing is cached. The key now changes only when the profile hastrueorfalse; a profile without one leaves each chat's own choice. This replaces the round 8 known effect for schedules. An apply by hand is unchanged from staging (see Follow-ups).roleplayCommandsEnabled()falls back toroleplayDmCommandsEnabled, andgetChatTranslationConfig/TranslationSectionfall back totranslationTargetLangandtranslationPrompt. All three are now listed, so the follower gets what an apply by hand gives (removed, or the profile's older value).customAgentImageSettingswhen the profile has none. It now asserts it, and removing the preservation fails.Rejected: none.
Checked and left as it is:
scopedRegexMode(the round 8 known effect) has the same shape, with the prompt preset in place of the connection. But its missing value is the visible Use preset switch in Chat Settings, so a follower that gets "use preset" shows the same switch as the saving chat and uses its own prompt preset's mode. Captioning and schedules have no such switch, so their missing value was invisible to the user.Follow-ups (not in this PR):
Round 8 (head
efa344a93)Fixed in
fa5577950, all insyncFollowerMetadataandapplyToChat(chat-presets.storage.ts):agentPromptTemplateIdswas copied whole, so a follower kept Lorebook Keeper, Knowledge Retrieval, Knowledge Router or Expression Engine on but lost the template picked in its add dialog (buildAgentAddMetadataPatch), and those agents fell back to their default prompts (resolveAgentPromptTemplate). The follower now keeps its own template entries for those four agents and gets the profile's for the rest.activeAgentIdsruns no agents:generate.routes.tsloads agent configs only when the list is non-empty (or a Roleplay command needs one), andruntime-agent-sections.ts,committed-tracker-context.ts,marker-expander.ts,chats.routes.tsand the retry route all treat an empty list as none. So a follower kept Director and Illustrator after a save from a chat that only runs set-up agents. The guard is gone; the follower now gets[]plus its own set-up agents. The staleChatMetadata.activeAgentIdsdoc comment ("empty = use globally-enabled agents") is corrected.multiplayer*prefix rule removed. It now uses an unlistedmultiplayerFutureStatekey, and the mutation fails.Rejected: none. Follow-ups: none.
Known effects of item 3, left as they are because an apply by hand does the same: a follower's own
scopedRegexModeoverride is removed when the saving chat inherits from its prompt preset, so the follower then inherits from its own preset; and a listed value written when the follower was created (for exampleconversationSchedulesEnabled: truewhen its characters had schedules) is removed when the saving chat has none, which for schedules still means "on when the chat has schedules" (areConversationSchedulesEnabled).Round 7 (head
cdf969f42)Fixed:
chatParametersholds only the differences from the chat's own connection defaults (AdvancedParametersSectionsetParameters), andcustomParametersare deep-merged raw into the provider body (base-provider.tsdeepMergeRequestBody). A follower on a direct Anthropic or Google connection got an OpenRouterproviderrouting object and other options from the saving chat and lost its own. Now a follower getschatParametersonly when itsconnectionIdequals the profile's, which is the connection the parameters were saved from. Explicit apply sets both together, as on staging.knowledgeAgentSources, not copied) and to the global agent settings, and a chat without its own sources falls back to the global ones, where manual lorebook ids skip the chat-scope filter. CopyingactiveAgentIdsturned the agent on in chats that never picked sources. These two agents now stay on or off as each follower has them.lorebookKeeperTargetLorebookId, Keeper picks the first writable book (which can be a character or world lorebook other chats share) as a non-explicit target. WithoutspriteCharacterIds, Expression Engine runs a model call every turn while the sprite overlay stays hidden. Both now stay on or off as each follower has them.All three are in
syncFollowerMetadata(chat-presets.storage.ts); the allowlist keeps both keys, with comments saying they copy only in part. Rejected: none.Round 6 (head
c320fde07)Fixed:
"narrator", but each kept its ownroleplayCommandNarratorId(null in a 1:1 chat or a group without a narrator).isRoleplayCommandAllowedthen refused those commands for every character there. The four audience keys are off the allowlist, so each chat keeps its own. Explicit apply is unchanged from staging (it also sets the profile's narrator id). Regression: the follower keeps"all", and roll, document and whisper stay allowed for its character.noodleTimelineContextEnabledlets Noodle use that chat's recent messages, a per-chat permission likediscordWebhookUrl. Off the allowlist; explicit apply unchanged.sceneVideoConnectionIdis a plain connection choice with no per-chat references, so it is now exempt from thescene*prefix rule, saved into profiles and on the allowlist. A profile without it leaves the chat's own on apply (see "Explicit apply and Save compared with staging").Rejected: none.
Known effect, left as it is:
groupChatModestays on the allowlist. If a follower group chat uses Individual narration with narrator-only commands and the profile says Merged, the update switches it to Merged, where narrator-only commands are not available (as when you switch it by hand; that chat's Roleplay Commands settings show the existing notice). Maintainer: say if narration mode should stay per chat instead.Round 5 (head
1ce025077)The maintainer asked for the allowlist after rounds 2 to 4 kept finding per-chat state that Save and update overwrote:
decisionTimers,spatialSharedWorldLink,authorNotes/authorNotesDepth,trackerFeaturedCharacterKeys,conversationSetupComplete, and PixelForge'spixelforge/pixelforgeCorruptExcerpt(from CodeRabbit threads). All are now untouched on followers by construction, and the four pure runtime keys plus PixelForge's two are also left out of profiles.authorNotes/authorNotesDepthstay profile content for an explicit apply, as on staging. The round 4 follower list (FOLLOWER_OWN_METADATA_KEYS) is gone; every key it named is simply not on the allowlist.Earlier rounds
Each finding was reproduced with the regression or traced in code.
excludedLorebookIdsandbackgroundfrom profiles everywhere; round 4 reverted that for explicit apply and Save (see below) and protects them on the follower path only.advancedMemoryRosterChangesis excluded, and the nestedknowledgeStarts,knowledgeConfirmedandnarratorCharacterIdstay with each chat (see What changed). This also resolves the earlier open question.encounterActive,archivedCharacterSnapshotsandconversationSummaryFailuresare excluded. A sweep of keys the server andChatAreawrite turned up the same problem forspriteExpressionsand the six Roleplay DM thread keys, so those are excluded too.customSystemPromptnow stays with the chat, matching howhandleModePromptPresetChangepairs it with the preset.failed).Round 4 (head
889064ff3)Fixed:
backgroundis out ofCHAT_PRESET_EXCLUDED_METADATA_KEYSagain, so Save stores it, an explicit apply sets it, profiles saved on staging keep it when read, and wizard defaults capture it, all as on staging. Followers keep their own. Regression: saved profile, explicit apply,GET /active/roleplayplus apply on a new chat, an old profile row, and the follower path.excludedLorebookIds) no longer saved or applied (medium). Same fix and regression as 1.chat-wizard-defaults.tsis back to staging.roleplayCommandNarratorIdis kept on the follower path. Explicit apply unchanged.lorebookKeeperTargetLorebookIdandknowledgeAgentSourcesare kept on the follower path. Explicit apply unchanged.GET /chatsfailed (low). The count now uses oneapi.get("/chats")and falls back to the loaded list when it fails. Not covered by a regression (a one-line client change).hideSummarisedMessageswithout hiding or showing the messages (low). Followers keep their own value, so a follower's toggle and its hidden messages stay in step. The same gap on explicit apply exists on staging and is left as it is under this PR's rule; filed as #7426.The follower-kept keys share one list,
FOLLOWER_OWN_METADATA_KEYSinchat-presets.storage.ts, which also absorbs the earliercustomSystemPromptspecial case. A follower that had no value for one of these keys stays without one. The regression checks both cases.Rejected: none. Every finding was reproduced with the regression or traced in code.
Behaviour audit: all rows agree with the code. The two "Regression" verdicts (
background,excludedLorebookIds) and the two follower "Defect" verdicts (roleplayCommandNarratorId, Lorebook Keeper and knowledge sources) are fixed above. The "worth confirming" row (conversationAboutMeOverrides,inactiveCharacterIds,conversationStatusOverrides) is listed for the maintainer under "Explicit apply and Save compared with staging".Docs:
settings-profiles.mdno longer calls the background or turned-off lorebooks running state, and the follower bullet lists what a chat keeps. Translation follow-up #7423 has a comment with the new wording. CHANGELOG entry updated to match.🤖 Generated with Claude Code
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.