mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #4111] [MERGED] Skip Noodle accounts whose character card no longer exists #6238
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#6238
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/4111
Author: @Gunterlie
Created: 7/25/2026
Status: ✅ Merged
Merged: 7/26/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/noodle-stale-character-accounts📝 Commits (1)
9d3adc2Skip Noodle accounts whose character card no longer exists📊 Changes
4 files changed (+201 additions, -3 deletions)
View changed files
📝
package.json(+1 -1)📝
packages/server/src/services/noodle/noodle-public-generation.service.ts(+16 -2)📝
packages/server/src/services/noodle/noodle-public-support.ts(+31 -0)➕
scripts/regressions/noodle-context.regression.ts(+153 -0)📄 Description
Linked issue
Closes #4110
Why this change
A Noodle account stores its own name and handle, independently of the character card it points at. When an account's
entityIdstops resolving to a character row, the account keeps working — and generation quietly degrades to nothing but names:# Active Noodle Accountsstill lists the account, because that data lives onnoodle_accounts.# Character Profilesfalls back to "No character profiles.", becausecharacters.getById(entityId)returnsnull(noodle-public-prompt.service.ts:330).# World / Loreis omitted entirely, because the lorebook scan is scoped to a character ID that cannot match anything (noodle-public-prompt.service.ts:438).No error is raised at any point. The model receives a list of names with no substance, invents its own authors to fill the gap, and those invented handles then fail
validateNoodleGeneratedRefresh— so the refresh fails with a confusing "no usable response" error two steps downstream of the actual problem.Accounts go stale on two paths, neither of which is exotic:
characters.remove(characters.storage.ts:544) deletes the character row and cleans up character groups, but never touchesnoodle_accounts.noodleAccounts.entityIdis a plain text column with no foreign key (db/schema/noodle.ts:11), so there is no cascade either, and nothing anywhere prunes accounts.characters.createmintsnewId()(characters.storage.ts:412), and the legacy profile import calls it for every restored character (backup.routes.ts:2536) while never touchingnoodle_accounts. A profile import therefore re-IDs every character and orphans every character account at once, without the user deleting anything.A stale account also crowds out healthy ones: participant selection picks N candidates without checking whether the entity still resolves, so a few stale accounts can consume every participant slot.
What changed
noodle-public-support.ts— newfilterResolvableNoodleParticipants(accounts, characters), returning{ resolvable, staleAccounts }. Non-character accounts are always kept (they have no character card to resolve).noodle-public-generation.service.ts— participant selection now runs on the resolvable set. Stale accounts are logged with handle andentityIdso this is diagnosable instead of silent.scripts/regressions/noodle-context.regression.ts(new, wired intopnpm regression:noodle) — asserts a healthy account carries its character card and activates character-scoped lorebook entries; then drops the character row and asserts the exact reported degradation (name present, no<character>block, no# World / Lore, zero activated entries); then asserts the stale account is filtered out and non-character accounts are kept.Not addressed here, deliberately: nothing stops stale accounts from being created. Pruning on character delete is a separate change with data-loss implications for posts, and it would not help installs that already have them. Worth a follow-up.
Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
[noodle] Skipping N Noodle account(s) whose character no longer exists: @handle (id)for that refresh.# World / Lorestill present in the logged prompt with Debug mode on.Automated, run locally:
pnpm --filter @marinara-engine/server exec tsx ../../scripts/regressions/noodle-context.regression.ts— passes with this change, fails without it (verified by reverting the helper).pnpm check— passes (one pre-existing unrelated client lint warning, 0 errors).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)
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.