mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2769] [Issue]: Chat Settings Advanced Parameters bakes full defaults into sparse overrides on first edit — silently clobbers the prompt preset #1407
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#1407
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/2769
Originally assigned to: @SpicyMarinara on GitHub.
Summary
The Advanced Parameters editor writes a FULL merged parameter object as chat overrides on every edit (rather than a sparse diff), so a single field edit silently clobbers the preset's untouched samplers, and concurrent edits race-drop each other.
Sub-bug 1: One edit bakes all 12 fields as chat overrides (new-bug)
(a)
effectiveParams = getEditableGenerationParameters(defaults, params)is a COMPLETE object (defaults from connection/mode, preset never consulted). On any field edit,set()doesonChange({ ...value, [key]: next })andsetParametersdoesonChatParametersChange({ ...params, ...next })— persisting all 12 fields. Since chat params apply AFTER the preset at serialization, a preset temperature 0.7 / topP 0.9 is silently reverted to defaults the moment the user edits any single Advanced Parameter (e.g. Max Output Tokens). The damaging set is the numeric/enum samplers; customParameters merges harmlessly.(b) Set preset temperature 0.7; open Advanced Parameters; change only Max Output Tokens; generate -> temperature is now 1.
(c) AdvancedParametersSection.tsx:44-50 (VERIFIED — params/effectiveParams at 44-45, setParameters spread at 48-50), 86-90 (value=effectiveParams); GenerationParametersEditor.tsx:140-142 (set spreads full value); server precedence generate.routes.ts:2072-2088 then 3502 / 3466-3484. Kind: new-bug.
Sub-bug 2: Concurrent edits race-drop (new-bug)
(a)
useUpdateChatMetadatahas no optimistic onMutate; the editor readsparamsfrom cache-derived metadata each render and builds{...params, ...next}from the render-captured value. Edit #2 before edit #1's PATCH returns carries pre-#1 params; the server replaces chatParameters wholesale (last-write-wins), so edit #1 is silently lost.(c) AdvancedParametersSection.tsx:48-50; use-chats.ts:501-522 (onSuccess only); chats.storage.ts:101-102 (top-level replace). Kind: new-bug.
Sub-bug 3: 'Reset to Defaults' writes defaults as explicit overrides (new-bug, related)
(a) Reset calls
onChatParametersChange(defaults)(a full object) instead of clearing, so the chat stays pinned to default values that override the preset — there's no UI affordance to truly clear chat-level overrides. NOTE: this is partly intentional given the documented preset<connection<chat precedence; the genuine gap is the missing 'clear overrides / use preset' affordance.(c) AdvancedParametersSection.tsx:149-154. Kind: new-bug (low; UX/missing-feature).
Suggested Fix
nextagainstdefaults(or track touched keys) and write only changed fields viaonChatParametersChange.useUpdateChatMetadata(or merge against a ref of latest committed params, or debounce+coalesce).{}(clear overrides) so preset/connection values apply; recompute the displayed defaults from{}.Template
pnpm checkpassesAffected files
packages/client/src/features/chat-settings/sections/AdvancedParametersSection.tsxpackages/client/src/components/ui/GenerationParametersEditor.tsxpackages/client/src/hooks/use-chats.tspackages/client/src/components/chat/ChatSettingsDrawer.tsxAudit 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\nWhat changed:\n- Advanced Parameters now persists sparse chat-level overrides: known editable fields matching the connection/mode defaults are omitted, while unknown existing parameter keys are preserved.\n- Reset to Defaults now clears chatParameters with {}, allowing preset/connection values to apply again instead of pinning defaults as explicit overrides.\n- useUpdateChatMetadata now applies an optimistic metadata merge and layers older server responses underneath newer optimistic metadata, reducing rapid-edit race drops.\n\nDeferred pnpm/check validation until the end of the issue sweep per maintainer request.
@kolacheee commented on GitHub (Jun 22, 2026):
Cross-reference: the user-visible "editing Advanced Parameters resets my preset" symptom is largely explained by #2801 (cache corruption —
useUpdateChatMetadataspreadschat.metadata, a JSON string, as an object, wipingappliedChatPresetId/activeAgentIds/agentOverridesfor the session). This issue (#2769, the AdvancedParametersSection baking connection/mode defaults into chat-level overrides) is a distinct, complementary defect on the same surface.