mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2767] [Issue]: Connection/chat-default sampler params override the active preset's samplers (resolution precedence) #1405
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#1405
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/2767
Originally assigned to: @SpicyMarinara on GitHub.
Summary
The preset->ChatOptions resolution layering has several gaps where connection/chat defaults silently win over the user's preset, plus latent overwrite/merge gaps in preset parameter storage. These are the 'works in ST, ignored here' class.
Sub-bug 1: Connection defaultParameters override the preset (new-bug / disputed-intent)
(a) When a chat has a prompt preset AND the connection has opted-in
defaultParameters, the code applies preset params first (generate.routes.ts:2072-2088) thenapplyParameterOverrides(connectionParams)(3501) UNCONDITIONALLY (noif (!presetId)guard), so the connection defaults clobber the preset's temperature/topP/topK/minP/maxTokens/penalties/reasoningEffort. Because the connection editor seeds the FULL field set when the toggle is enabled, ALL preset samplers get clobbered, not just changed ones.(b) Set a preset temperature 0.7; on the connection enable custom default parameters (leaves temperature 1); generate -> request uses temperature 1.
(c) generate.routes.ts:1969-2094 (preset block), 3460-3502 (unconditional connection override; VERIFIED no presetId guard); same pattern dry-run-route.ts:1217-1239. NOTE: in-product help text ('chats can still override these in Chat Settings') leans toward connection>preset being intended, so the correct precedence is a design decision — but it contradicts the connection-preset-pipeline-priority principle and ST parity. Kind: new-bug (precedence; verify intended layering with maintainer).
Sub-bug 2: chatParameters frozen at creation, stale after connection switch (new-bug)
(a) On chat creation, if the connection has
defaultParameters, the server bakes the FULL blob intometadata.chatParameters. Because chat params apply after the preset, this overrides the preset from the start; worse, switching the chat's connection never refresheschatParameters, so every later generation uses stale sampler params from the ORIGINAL connection (and the live connection defaults are also applied then clobbered by the frozen copy).(b) Create a chat against connection A (which has defaultParameters); switch the chat to connection B; generate -> uses A's frozen samplers.
(c) chats.routes.ts:442-460 (bake), generate.routes.ts:3501-3502 (connection then chat override), chats.routes.ts:466-483 / chats.storage.ts:315-340 (update never touches metadata). Kind: new-bug.
Sub-bug 3: Partial parameters PATCH / assembler no-default-merge (new-bug, latent)
(a)
updatePromptPresetSchema.parametersisgenerationParametersSchema.partial().optional()andprompts.storage.updateoverwrites the whole stored blob with no merge; the assembler raw-JSON.parses it with no DEFAULT merge. A partial blob therefore loses unspecified fields, and an empty blob ('{}') leaves temperature/maxTokens undefined (the other fields have?? defaultguards at 2074-2086 but 2072-2073 do not). VERIFIED reachable in principle, but no first-party caller currently sends a partialparametersobject (PresetEditor round-trips the full object), so this is a latent robustness gap that providers' own?? 4096/?? 1re-defaults largely absorb.(c) prompt.schema.ts:155, prompts.storage.ts:79, assembler.ts:213, generate.routes.ts:2072-2088. Kind: new-bug (latent).
Suggested Fix
applyParameterOverrides(connectionParams)behindif (!presetId)(keep chat overrides top-priority), in both generate.routes.ts and dry-run-route.ts.chatParametersat chat creation (the pipeline already applies live connection defaults); leave chatParameters sparse/user-driven, OR re-derive on connection switch.prompts.storage.update.Template
pnpm checkpassesAffected files
packages/server/src/routes/generate.routes.tspackages/server/src/routes/chats.routes.tspackages/server/src/services/prompt/assembler.tspackages/server/src/services/storage/prompts.storage.tspackages/shared/src/schemas/prompt.schema.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: MEDIUM.@SpicyMarinara commented on GitHub (Jun 21, 2026):
Fixed in PR #2747.\n\nWhat changed:\n- generation and dry-run only apply connection default parameters when no prompt preset is active, preserving preset sampler intent\n- chat Advanced Parameters still apply after preset/connection defaults, so explicit per-chat overrides remain highest priority\n- new chats no longer bake connection defaults into metadata.chatParameters, avoiding stale sampler blobs after connection switches\n- preset assembly merges partial/legacy parameter blobs over DEFAULT_GENERATION_PARAMS\n- prompt preset parameter PATCHes now merge partial updates over the stored blob plus defaults instead of replacing the whole parameter object\n\nDeferred pnpm/check validation until the end of the issue sweep per maintainer request.