mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2764] [Issue]: Image-generation connection defaults silently dropped on every save (params schema strips the imageGeneration key) #1402
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#1402
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 @kolacheee on GitHub (Jun 21, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2764
Originally assigned to: @SpicyMarinara on GitHub.
Summary
Every save of an
image_generationconnection's Local Image Defaults (steps, CFG, sampler, scheduler, seed, denoise, clip skip, style profile, NovelAI/A1111/ComfyUI prefixes) is silently and completely lost. The save flashes success, but the values never persist and image generation continues using built-in defaults. Findings #1 and #34 are the same root-cause bug verified from two angles.Sub-bug:
imageGenerationblob stripped by generation-params schema on save (new-bug)(a) How it breaks the pipeline
The client stores image defaults nested under
defaultParameters["imageGeneration"](IMAGE_DEFAULTS_STORAGE_KEY === "imageGeneration"). The PUT/:id/default-parametersroute validates the whole body withgenerationParametersSchema.partial().safeParse(raw)and persistsparsed.data.generationParametersSchemais a plainz.objectwith noimageGenerationkey and no.passthrough()/.catchall(), so Zod strips the unknown key:safeParse({imageGeneration:{...}})returnssuccess:true, data:{}.updateDefaultParametersthen does a full overwrite (JSON.stringify(params)->'{}'), destroying the prior image blob. On read-back the server'sresolveConnectionImageDefaultsreadsparams['imageGeneration'](now undefined) and falls back tocreateDefaultImageGenerationProfile.(b) Steps to replicate
image_generationconnection.(c) Code trace
ConnectionEditor.handleSaveimage branch (ConnectionEditor.tsx:423-435) ->buildImageDefaultParameters(ConnectionEditor.tsx:2714-2725) builds{ imageGeneration: {...} }.useSaveConnectionDefaults(use-connections.ts:168-178) PUTs verbatim.generationParametersSchema.partial().safeParse(raw)(connections.routes.ts:295) — VERIFIED present at lines 286-309; the route has a special-case forraw === null/non-object but noimageGenerationallowance.generationParametersSchema(prompt.schema.ts:37-66) has noimageGenerationkey, no passthrough -> key stripped.updateDefaultParameters(connections.storage.ts:256-261) full-overwrite to'{}'.resolveConnectionImageDefaults(image-generation-defaults.ts:25-31) -> default profile.Kind: new-bug.
Suggested Fix
Do not route image-defaults bodies through
generationParametersSchema. Either (a) detect/allow theimageGenerationkey in the PUT route (dedicated image-defaults schema, or.passthrough()), or (b) read existingdefaultParametersand merge validated generation keys into it rather than replacing withparsed.data, preserving unknown top-level keys (especiallyimageGeneration).Template
imageGenerationblob on save round-trippnpm checkpassesAffected files
packages/server/src/routes/connections.routes.tspackages/server/src/services/storage/connections.storage.tspackages/client/src/components/connections/ConnectionEditor.tsxpackages/shared/src/schemas/prompt.schema.tspackages/server/src/services/image/image-generation-defaults.tsAudit provenance
Found by a multi-agent re-review of the connection/preset subsystem (editors UI + send-pipeline) against the merged
stagingtree (Round 1 + round-2 gap sweep + completeness critic, each finding adversarially verified). The prior #2656-#2668 fixes were re-verified as HELD on their primary paths. Severity: HIGH.@SpicyMarinara commented on GitHub (Jun 21, 2026):
Fixed in PR #2747.\n\nThe default-parameters route still validates known text-generation fields through generationParametersSchema, but now explicitly carries the shared imageGeneration defaults envelope through the save payload before storage overwrite. That prevents image-generation connection defaults from being stripped to {} on save while keeping the existing text parameter validation path intact.\n\nDeferred pnpm/check validation until the end of the issue sweep per maintainer request.