mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #4377] [MERGED] Fix startup crash from legacy visual_novel mode in packaged agent manifests #6354
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#6354
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/4377
Author: @Gunterlie
Created: 7/31/2026
Status: ✅ Merged
Merged: 7/31/2026
Merged by: @Gunterlie
Base:
staging← Head:fix/visual-novel-startup📝 Commits (4)
73b0d18Fix startup crash from legacy visual_novel mode in packaged agent manifestsba6cf4fNormalize retired visual_novel mode on load instead of orphaning rows49f3f12Merge branch 'staging' into fix/visual-novel-startup62c3348Merge branch 'staging' into fix/visual-novel-startup📊 Changes
3 files changed (+42 additions, -3 deletions)
View changed files
📝
packages/server/src/db/file-backed-store.ts(+12 -2)➕
packages/server/src/db/retired-chat-mode-migration.ts(+17 -0)📝
packages/shared/src/schemas/capability-package.schema.ts(+13 -1)📄 Description
Fixes #4375
Why
#4369 removed
visual_novelfrom supported enums without migrating data that already exists on users' machines.Startup crash. Installed capability packages still list
visual_novelinmodeAllowlist(world-state@1.0.1is the reported case).readInstalledAgentDefinitionsparses those manifests strictly, so one stale package throws aZodErrorduringbuildAppand the server never starts:Orphaned rows. Chats, chat folders, and chat settings profiles stored with
mode: "visual_novel"do not crash anything — the file-backed store does not validate enum columns — but every lookup filters by one of the three live modes, so that data silently stops showing up.What
Both halves normalize
visual_noveltoroleplay, its behavioural successor, rather than dropping it.packages/shared/src/schemas/capability-package.schema.ts—modeAllowlistmaps the retired value before the enum parse (and dedupes, since["roleplay", "visual_novel"]is the common shape). Filtering it out instead would turn avisual_novel-only allowlist into an empty one, which the agent policy reads as "available in every mode".packages/server/src/db/retired-chat-mode-migration.ts(new) +file-backed-store.ts— rewritesmodeon load forchats,chat_folders, andchat_presets, following the existingmigrateLegacyNoodleAccountRowhook. Marks the table dirty so the rewrite persists once instead of re-running every boot.Test plan
world-state@1.0.1installed (modeAllowlist: ["roleplay", "visual_novel"])visual_novelchat opens and behaves as a Roleplay chatvisual_novelchat settings profile appears in the Roleplay profile listpnpm checkSummary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.