mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #4110] [Issue]: One invalid field silently resets all Noodle settings #2227
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#2227
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?
Originally created by @Gunterlie on GitHub (Jul 25, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/4110
Summary
One invalid field in the stored Noodle settings silently discards every Noodle setting and reverts them to defaults. Users lose choices they never touched — Lorebook context, invited character folders, the generation connection — with no log line and no UI signal.
Expected behavior
If a single stored settings field fails validation, only that field should fall back to its default. Every other stored value should be preserved, and the server should log which field was rejected.
Actual behavior
normalizeNoodleSettingsinpackages/server/src/services/storage/noodle.storage.tsdoes this:Any single unparseable field throws away the whole object. The user-visible result is that Noodle settings appear to reset themselves, and the reset is completely silent — no warning, no error, nothing in the logs to diagnose it after the fact.
The most visible downstream symptom is Noodle timeline generation.
enableLorebookContextdefaults tofalseandinvitedCharacterGroupIdsdefaults to[], so after a reset:# Character Profilesin the refresh prompt falls back to "No character profiles." (noodle-public-prompt.service.ts:531)# World / Loreis empty (noodle-public-prompt.service.ts:438)The model then receives little more than the account name list and invents unrelated content. This was reported on Discord by a user whose Noodle posts abruptly stopped reflecting their character cards and Star Wars lorebooks, producing generic output about kings and copper coins instead.
The blast radius grows each time a narrow field is added to the settings schema.
autoPostingDefaultIntensity: z.union([z.literal(1), z.literal(3), z.literal(6)]), added in0ac4d396f, is exactly that shape: one out-of-range stored value resets everything else.Steps to reproduce
noodle.settingsvalue soautoPostingDefaultIntensityis an invalid number, e.g.4.Environment
staging@3d5732ad0)normalizeNoodleSettingsLogs, screenshots, or video
No logs are produced — that is a core part of the problem. On the current
stagingcode path the reset leaves no trace whatsoever.Additional context
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.scripts/regressions/noodle-settings.regression.ts.Template check
@SpicyMarinara commented on GitHub (Jul 25, 2026):
Resolved by #4109 and merged into
stagingin21635e06c9.@Gunterlie commented on GitHub (Jul 26, 2026):
Root cause found, with the reporter's raw request logs. The prompt body was never sent to the model.
buildRefreshPromptreturns three messages (noodle-public-prompt.service.ts:621); two arrived. The context body — accounts, character profiles, world/lore, timeline — was deleted in transit. Both attached logs show the same shape across four requests.Mechanism, in
fitMessagesToContext:findOldestRemovableConversationBlock(base-provider.ts:332) protects only system messages and the final message. The first user message — the whole prompt body — is removed first.contextKindnowhere, so the fallback pass at:460treats that body as expendable history.max_tokensis only reduced once the input budget hits the 128-token floor (:422), leaving a window where the budget is too small for the prompt but too large to trigger the reduction. So the prompt is deleted whilemax_tokenskeeps its full value.A stored
max_tokens: 32768against a ~36k window leaves ~3.3k input budget; a ~4k prompt gets deleted andmax_tokensstays 32768 — matching the capture exactly, down to the 1210 prompt tokens the backend reported.Fix in #4124. Not Noodle-specific: any single-shot prompt builder is exposed.
Correcting the record on the other two PRs. Neither is this bug:
allowRandomUsersdefaults to false so it never explained the reported symptoms.Both stand on their own merits; neither should be described as the fix for this report.