mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2773] [Issue]: Connection/preset number & URL input validation gaps + chat-settings preset reset/reconcile gaps #1410
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#1410
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/2773
Originally assigned to: @SpicyMarinara on GitHub.
Summary
Client-side number/URL inputs lack validation matching the server schema (a bad value blocks the entire save with a generic error), the ParamInput display can desync from the saved value, and the chat-settings-preset selector has reset/reconcile gaps including a presetChoices clobber.
Sub-bug 1: Max Context allows 0 (new-bug)
(a) The Max Context DraftNumberInput is
min={0}; committing 0 yields maxContext:0 in the PATCH, which the serverz.number().int().min(1)rejects -> 400 -> the WHOLE connection save aborts (name/key/model/params lost) with a generic 'Save failed' and no field-level hint.(c) ConnectionEditor.tsx:1556-1565/389/416-441; DraftNumberInput.tsx:53-71; connection.schema.ts:29. Kind: new-bug.
Sub-bug 2: Base URL / Embedding URL no validation (new-bug)
(a) Bare host:port / scheme-less URLs (common for local models, e.g.
192.168.1.5:8080) fail the server.url()and block the whole save with a generic banner and no field highlight. (Note:localhost:11434/v1actually passes Zod, contrary to the original example.)(c) ConnectionEditor.tsx:1086-1101/1875-1883/387/395; connection.schema.ts:25/36. Kind: new-bug.
Sub-bug 3: ParamInput stale display (new-bug)
(a) On out-of-range/empty entry, ParamInput.commit only setError — never onChange and never reverts draft to value. The box keeps showing the rejected value while the parent/saved value stays the old one, so the display lies about what will be saved (no corruption).
(c) GenerationParametersEditor.tsx:516-554. Kind: new-bug (low).
Sub-bug 4-5: Chat-settings-preset reset/reconcile no-ops (ux/validation)
(a) When
appliedChatPresetIdis null OR points at a deleted preset,selectedChatPresetfalls back to the Default preset, so the dropdown shows 'Default' buthandleSelectPreset'sid === selectedChatPreset?.idguard makes selecting Default a no-op — the chat can't be reset and a dangling dead id is never cleared.(c) ChatSettingsDrawer.tsx:2149-2156/2401-2404; chat-presets.storage.ts:261-309. Kind: new-bug (medium).
Sub-bug 6: presetChoices clobber on chat-preset apply (data-loss/missed-instance)
(a)
snapshotCurrentPresetSettingscaptures the whole metadata incl.presetChoices(per-chat variable answers, keyed by variableName). presetChoices is NOT in CHAT_PRESET_EXCLUDED_METADATA_KEYS, so it's stored in the chat-settings preset and, on apply, overwrites the target chat's own choices (it's not in the preserved set) -> wrong/garbage variable values injected at serialization. The sibling per-chatagentVariablesIS excluded, showing presetChoices was simply missed.(c) ChatSettingsDrawer.tsx:2393-2399/2411-2459; chat-presets.storage.ts:88/277-298; chat-preset.ts:45-112. Kind: missed-instance (medium).
Suggested Fix
min={1}(or clamp <1 in payload); add field-level validation surfacing.presetChoicesto CHAT_PRESET_EXCLUDED_METADATA_KEYS.Template
pnpm checkpassesAffected files
packages/client/src/components/connections/ConnectionEditor.tsxpackages/client/src/components/ui/DraftNumberInput.tsxpackages/client/src/components/ui/GenerationParametersEditor.tsxpackages/client/src/components/chat/ChatSettingsDrawer.tsxpackages/server/src/services/storage/chat-presets.storage.tspackages/shared/src/constants/chat-preset.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. Verified the findings against the current branch and addressed the still-valid parts: Max Context now clamps to at least 1, Base URL and Embedding Endpoint URL validate/normalize bare local endpoints before save, ParamInput reverts rejected drafts to the saved value, chat-settings preset selection distinguishes custom/missing state so Default can reset, and presetChoices is excluded from chat-settings preset snapshots. Full pnpm validation is intentionally deferred until the remaining open issue is addressed.