mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-08-27 04:07:05 +00:00
* fix: render Google settings from the shared schema and bound them correctly
Google was the last endpoint hand-rolling its own sliders. The schema was
already there and already wired, only the frontend never used it, so
rendering from it replaces 315 lines with the body OpenAI, Anthropic and
Bedrock share.
That closed a functional gap rather than only moving code: the old form
exposed six fields where the schema declares fifteen, so Resend Files,
Thinking, Thinking Budget, Thinking Level, Grounding with Google Search,
URL Context and File Token Limit were unreachable from a Google preset.
resendFiles is added to the Google schema so its switch round-trips, and
the endpoint type is resolved from the endpoints config, since a preset
for a Google-compatible endpoint need not carry endpointType and would
otherwise blank the panel.
Sharing the controls also meant inheriting their gaps, which this fixes:
- Number settings declared a range that nothing enforced, so a value past
the provider's ceiling was persisted and rejected later. clampSettingRange
applies it, and generateDynamicSchema validates the same rule, so the
definition is the single source of truth for both.
- Thinking budget bounds are per model. The generic range capped 2.5 Pro
below its documented 32,768 and admitted Flash values above 24,576.
positiveMin carries the documented floors while -1 stays typeable as the
decide-automatically sentinel.
- Ranges the model narrowed are marked modelSpecific, so a switch to a
model that ignores the parameter cannot rewrite a value set for another.
- useDebouncedInput rebuilt its debouncer every render, because neither
setOption nor the inline setter is memoized, so pending edits were never
really superseded and a flush reached an instance holding nothing. The
callbacks move to refs, and the text and slider controls flush on blur or
value commit so Save and Export cannot read a stale preset.
- Controls reset to their definition default on a conversation or preset
change and only recovered ~560ms later, which showed saved values as
defaults and could write the default back.
The debounce regression test fails against the previous memo dependencies
and passes with the refs, so the flush is verified rather than assumed.
* fix: keep the context token bounds on the Google setting
The bounds came from the hand-rolled Google editor, but they were added to
the shared definition every endpoint renders, so blurring the field clamped
OpenAI, Anthropic, Bedrock and custom endpoints to a window that is only
Gemini's. Custom endpoints may declare context windows outside it.
* fix: agree with the generated schema across the sentinel gap
A stored value between range.min and zero passed through clampSettingRange
unchanged, though the schema admits only the sentinel or the positive floor,
so normalization could preserve a value the provider then rejects. Validate
a configured default against the same rule.
* fix: keep positiveMin on configured parameter definitions
The runtime schema for customParams.paramDefinitions retained only min, max
and step, so a configured positive floor was stripped before the UI saw it
while the shared SettingRange type advertised it.
* fix: commit a double-click slider reset immediately
The browser dispatches dblclick after the second pointer release, so the
value commit has already flushed and the reset sat in the debouncer. Saving
or exporting inside that window read the value the slider no longer showed.
* fix: normalize an out-of-range stored value on mount
The applied-range ref started at the first range, so the effect returned
immediately and a budget saved under the shared range stayed displayed and
savable when the selected model no longer allowed it.
* fix: normalize on navigation and keep sliders out of the sentinel gap
The parameters panel stays mounted across conversations, so a legacy budget
could arrive under a range that never changed; keying the normalization on
the conversation or preset identity as well catches it. After a navigation
the local value still belongs to the conversation being left, so the
incoming stored value is what gets normalized.
A slider steps straight through the gap between a sentinel minimum and its
positive floor, which the generated schema rejects, so the committed value
is clamped. It is also set before the flush: the keyboard path commits
before it reports the change, so the flush alone had nothing to write.
* fix: close the remaining paths into the sentinel gap
Applying a preset over the open conversation replaces the stored value
without changing the conversation id or the model, so normalization now also
triggers on a stored value that arrives differing from the local one. A
value the user typed reaches the conversation through this same field and
matches by the time it lands, so it stays on the blur-clamped path.
The slider's adjacent number input only flushed on blur, so a typed value
could sit in the gap the track is now kept out of.
A configured positiveMin above the maximum admits nothing but the sentinel
while the clamp maps every non-negative input onto a maximum the generated
schema rejects, so both the config schema and the definition validator
refuse it.
* fix: keep a non-negative sentinel and a loadable slider default
The minimum is the sentinel whatever its sign, and the generated schema
admits it outright, so a range like { min: 0, positiveMin: 10 } no longer
has its 0 lifted to the floor by the clamp.
The synthesized slider default took the midpoint of the whole range, which
for a sentinel range lands in the gap the validation added alongside it, so
an otherwise coherent custom definition failed to load. It now takes the
midpoint of the admissible interval.
---------
Co-authored-by: Danny Avila <danny@librechat.ai>
|
||
|---|---|---|
| .. | ||
| actions.spec.ts | ||
| api-endpoints-subdir.spec.ts | ||
| api-endpoints.spec.ts | ||
| azure.spec.ts | ||
| bedrock.spec.ts | ||
| config-schemas.spec.ts | ||
| filetypes.spec.ts | ||
| generate.spec.ts | ||
| headers-helpers.spec.ts | ||
| mcp.spec.ts | ||
| openapiSpecs.ts | ||
| parsers.spec.ts | ||
| parsers.timezone.spec.ts | ||
| providers.spec.ts | ||
| request-interceptor-subdir.spec.ts | ||
| request-interceptor.spec.ts | ||
| stateful-code.spec.ts | ||
| utils.spec.ts | ||