mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #4109] [MERGED] Stop one invalid field from resetting all Noodle settings #6236
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#6236
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/4109
Author: @Gunterlie
Created: 7/25/2026
Status: ✅ Merged
Merged: 7/25/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/noodle-settings-partial-fallback📝 Commits (1)
1e56d89Stop one invalid field from resetting all Noodle settings📊 Changes
2 files changed (+42 additions, -4 deletions)
View changed files
📝
packages/server/src/services/storage/noodle.storage.ts(+22 -3)📝
scripts/regressions/noodle-settings.regression.ts(+20 -1)📄 Description
Linked issue
Closes #4110
Why this change
normalizeNoodleSettingsthrew away the entire stored Noodle settings object whenever zod rejected any single field, silently reverting choices the user never touched —enableLorebookContext,invitedCharacterGroupIds,generationConnectionId, refresh limits, and the rest.autoPostingDefaultIntensity: z.union([z.literal(1), z.literal(3), z.literal(6)])(added in0ac4d396f) is exactly this shape: one out-of-range stored value nukes everything else.What changed
packages/server/src/services/storage/noodle.storage.ts— on parse failure, collect the rejected top-level keys fromparsed.error.issues, drop only those from the candidate object, and re-parse so the schema defaults just the bad fields. All other stored values survive.logger.warnnaming the rejected fields, so the next occurrence is diagnosable instead of silent.logger.errorwith the zod error.scripts/regressions/noodle-settings.regression.ts— new assertion: settings carrying an invalidautoPostingDefaultIntensityretainenableLorebookContext,invitedCharacterGroupIds,generationConnectionId, andrefreshesPerDay, while only the bad field falls back to its default.Note: this fixes the mechanism that can silently reset Noodle settings. It is not confirmed to be the cause of the specific Discord report — that user's settings still need to be inspected to confirm which path reset them.
Possible originating report (investigated — see follow-up below)
This may be the cause of the following Discord report by AgentX — but that is a hypothesis, not a confirmed link. The user's stored settings still need to be inspected before anyone treats this as the fix for their case.
https://discord.com/channels/1417099416812392641/1495493775617687775/1530687702653997126
The described symptom — account names present, character cards and lorebook entries absent — matches what a settings reset to defaults produces (
enableLorebookContext: false,invitedCharacterGroupIds: []). Other paths could produce the same output, so this stays labelled as a possible cause until confirmed.Follow-up report — this hypothesis now looks unlikely
A later message from AgentX:
Two things follow from this, and they point away from the settings-reset bug:
Kaelen_Storm/Elara_Whisperare authors the model invented because the prompt gave it nothing to work from.validateNoodleGeneratedRefreshrejects handles outside the known set (noodle-public-generation.service.ts:351-353), triggers one correction retry, and throws on a second failure (:411) — which is the "couldn't update timeline because there's no responses" error they saw.allowRandomUsersis off, and its default is alreadyfalse. A reset to defaults could not have enabled random users, and the user confirms they are off. So the settings-wipe path does not explain this report.With
allowRandomUsersoff,chooseNoodleParticipantAccountsonly yields character-kind candidates (noodle-participant-selection.ts:73-76). Selection clearly succeeded — otherwise generation would have stopped with "Invite a character, select a character folder, or enable random users before refreshing" (noodle-public-generation.service.ts:236-239). So character accounts were selected, yet# Character Profileswas still empty.That leaves a more likely root cause:
characters.getById(account.entityId)returnednullfor every selected account (noodle-public-prompt.service.ts:330). Orphaned Noodle accounts — rows whoseentityIdno longer resolves to a character — would produce exactly this. The account name list still renders (it comes fromnoodle_accounts), the character cards vanish, and the lorebook scan is scoped to character IDs that do not exist, so no entries activate. Every symptom in both reports, from one cause.Worth noting: nothing prunes
noodle_accountswhen a character is deleted — there is no delete/prune path innoodle.storage.ts— so orphaned accounts persist and keep getting picked as participants.Next diagnostic step: for each invited Noodle account of kind
character, check whether acharactersrow with thatentityIdstill exists.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
noodle.settingsvalue to setautoPostingDefaultIntensityto an invalid number (e.g.4). Reload Noodle Settings and confirm the lorebook toggle and invited folders are still set, and only the intensity fell back to1.Noodle settings had invalid field(s); falling back to defaults for: autoPostingDefaultIntensityin that case.[debug/noodle] Activated N lorebook entr(ies)and that# Character Profilesis populated in the logged prompt.Automated, run locally:
pnpm --filter @marinara-engine/server exec tsx ../../scripts/regressions/noodle-settings.regression.ts— passes with this change, fails without it (verified by reverting the storage file).Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)UI evidence (if applicable)
Summary by CodeRabbit
Bug Fixes
Tests
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.