mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #1784] [Issue]: Prompt and chat settings preset parity regressions in refactor #867
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#867
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 @Xelvanis on GitHub (Jun 1, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1784
Originally assigned to: @SpicyMarinara on GitHub.
Summary
Static parity audit found several preset regressions in the refactor branch versus the legacy package implementation. The highest-risk items are shallow prompt preset duplicate/delete behavior, changed runtime prompt preset precedence, and broken chat-settings preset import/export envelope handling.
Expected behavior
Prompt presets should preserve legacy-compatible workflows:
marinara_chat_presetenvelope and sanitize/import it through the preset contract.Actual behavior
Refactor evidence from static inspection:
src/features/catalog/presets/hooks/use-presets.tscalls genericstorageCommandsApi.duplicate("prompts", id)for prompt preset duplication.src-tauri/src/commands/storage/shared.rsgenericduplicate_recordonly copies the root record and does not copy/remap prompt child records.src-tauri/src/commands/storage/commands/entities.rsgeneric delete only has special child cleanup for lorebooks, not prompt presets.src/engine/generation/prompt-preset-selection.tscurrently orders candidates as impersonate, chat, request, connection, and only allows connection overrides forroleplay.packages/server/src/routes/generate/prompt-preset-selection.tsordered candidates as impersonate, request, connection, chat, and allowedroleplayplusvisual_novel.src/features/modes/shared/chat-ui/components/ChatSettingsDrawer.tsxexports the raw selected chat preset JSON instead of amarinara_chat_presetenvelope.src/features/catalog/chat-presets/hooks/use-chat-presets.tsimports chat presets with rawstorageApi.create("chat-presets", envelope), while legacy parsed and sanitized the envelope through the chat preset route/storage contract.Steps to reproduce
prompt-groups,prompt-sections, andprompt-variablesfor rows still pointing at the deletedpresetId.Impact area
Environment
refactorlineage, inspected from a branch based onorigin/refactorLogs, screenshots, or video
No runtime logs or screenshots. Evidence is static code comparison against the legacy package implementation.
Regression notes
Legacy reference points:
packages/server/src/services/storage/prompts.storage.tshad prompt-awareduplicate,remove,setDefault, child reorder, and child copy/remap logic.packages/server/src/routes/generate/prompt-preset-selection.tsused request and connection prompt preset overrides before chat fallback.packages/server/src/routes/chat-presets.routes.tsexported/importedmarinara_chat_presetenvelopes.packages/server/src/services/storage/chat-presets.storage.tsprotected default chat presets and handled active fallback after deletion.Additional context
Suggested repair order:
marinara_chat_presetenvelopes.Template check
Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked:
@Xelvanis commented on GitHub (Jun 1, 2026):
Additional chat-settings preset parity findings
A focused chat-presets pass found a few issues not fully captured above:
Confirmed regressions
storage_duplicate;src-tauri/src/commands/storage/shared.rsduplicate_recordonly removesidand preservesisDefault/isActive/ aliases. Legacypackages/server/src/services/storage/chat-presets.storage.tsalways inserted duplicates withisDefault: "false"andisActive: "false".src/features/catalog/chat-presets/hooks/use-chat-presets.tsbuilds a chat patch from current metadata plus preset metadata and only changesconnectionId/promptPresetIdwhen those keys exist. This means applying the Default preset{}cannot reset old connection, prompt preset, tools, agents, translation, memory, or advanced flags. Legacypackages/server/src/services/storage/chat-presets.storage.tsrebuilt metadata from base defaults + preset metadata + preserved chat-owned fields, so preset-owned settings were cleared/reset.useImportChatPresetcallsstorageApi.create("chat-presets", envelope)and export writes the raw selected row fromChatSettingsDrawer.tsx.FileStorage.createpreserves a suppliedidand replaces any existing same-ID row. Legacy import expected amarinara_chat_presetenvelope and created a new inactive, non-default preset.Likely parity gap
settingsas a JSON string. Refactor maps legacychat_presetstochat-presets, but typed normalization only parsesparametersfor that collection, notsettings. Client sanitizer expects object settings. Legacy storage parsed rowsettingsbefore returning a preset.Suggested split/repair order
marinara_chat_presetenvelopes and always mint a new inactive non-default row.settingsobjects and protect default chat presets below the UI layer.Evidence is static code comparison only; no runtime reproduction was run.
@SpicyMarinara commented on GitHub (Jun 1, 2026):
Fixed on refactor in 37bb88aa.\n\nWhat changed:\n- Prompt preset runtime precedence now matches legacy: impersonate, request, connection for roleplay/visual novel, then chat.\n- Prompt preset duplicate/delete now deep-copies/remaps groups, sections, variables, and cascades children on delete.\n- Chat preset export/import now uses the marinara_chat_preset envelope and sanitizes imported settings.\n- Chat preset apply now replaces preset-owned state with defaults + preset metadata while preserving chat-owned scene/runtime fields.\n- Default chat presets are protected from delete/update, and active deletion falls back to the mode default.\n- Legacy JSON-string settings are normalized for chat presets.\n\nVerification:\n- pnpm typecheck\n- pnpm check:architecture\n- cargo check --manifest-path src-tauri/Cargo.toml\n- git diff --check HEAD~1..HEAD