Skip to content

#12158 Remove parameters from the UI in the "Parameters" side panel which are in dropParams#12160

Open
evolkis wants to merge 2 commits intodanny-avila:mainfrom
evolkis:feat/remove-dropParams-from-param-side-panel
Open

#12158 Remove parameters from the UI in the "Parameters" side panel which are in dropParams#12160
evolkis wants to merge 2 commits intodanny-avila:mainfrom
evolkis:feat/remove-dropParams-from-param-side-panel

Conversation

@evolkis
Copy link

@evolkis evolkis commented Mar 9, 2026

…tup Config, remove these params from the UI under "Parameters" side panel

Pull Request Template

⚠️ Before Submitting a PR, Please Review:

  • Please ensure that you have thoroughly read and understood the Contributing Docs before submitting your Pull Request.

⚠️ Documentation Updates Notice:

  • Kindly note that documentation updates are managed in this repository: librechat.ai

Summary

PR to address #12158 - Remove parameters from the UI in the "Parameters" side panel which are in dropParams.

We want to have it where any param listed in the dropParam array in the configuration file, will be removd from the parameters side panel, so that it is not confusing to the end user.

We add a variable to the stratUpConfig which is a Map, mapping custom endpoint names to the array of dropParams. These are then filtered out in Parameters/Panel.tsx

Change Type

Please delete any irrelevant options.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • Translation update

Testing

Configure enpoints that have dropParams in the yaml config file. Run LibreChat and ensure those Parameters are removed from Param Side Panel

Test Configuration:

Checklist

Please delete any irrelevant options.

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • I have commented in any complex areas of my code
  • I have made pertinent documentation changes
  • My changes do not introduce new warnings
  • I have written tests demonstrating that my changes are effective or that my feature works
  • Local unit tests pass with my changes
  • Any changes dependent on mine have been merged and published in downstream modules.
  • A pull request for updating the documentation has been submitted.

evolkis added 2 commits March 6, 2026 10:57
…tup Config, remove these params from the UI under "Parameters" side panel
…e and dropParams array. Remove dropParams from Param side panel
Copilot AI review requested due to automatic review settings March 9, 2026 18:32
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses issue #12158 by hiding parameters from the UI "Parameters" side panel when they are listed in dropParams for custom endpoints in the YAML configuration file. Previously, dropParams only affected the server-side API requests but the parameters still appeared in the UI, causing confusion.

Changes:

  • Added a new endpointsDropParamsMap field to TStartupConfig that maps custom endpoint names to their dropParams arrays
  • Built the endpoint-to-dropParams mapping on the server in the /config route and included it in the startup config response
  • Filtered out dropped parameters in the Parameters side panel component using the startup config data

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
packages/data-provider/src/config.ts Added endpointsDropParamsMap field to TStartupConfig type
api/server/routes/config.js Added getEndpointsDropParamsMap function to extract dropParams from custom endpoints and included the result in the startup config payload
client/src/components/SidePanel/Parameters/Panel.tsx Consumes the new endpointsDropParamsMap from startup config to filter out dropped parameters from the UI

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

if (endpoint && Array.isArray(endpoint.dropParams)) {
dropParams.push(...endpoint.dropParams);
if (dropParams.length > 0) {
result[endpoint.name] = dropParams;
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The endpoint name should be normalized using normalizeEndpointName to match how endpoint names are stored elsewhere in the codebase (e.g., in loadCustomEndpointsConfig at packages/api/src/endpoints/custom/config.ts:39 and loadConfigModels at api/server/services/Config/loadConfigModels.js:65). Without normalization, if a user configures an endpoint named "Ollama", the key in this map would be "Ollama", but conversation.endpoint on the client side would be "ollama" (the normalized form), causing a lookup miss.

Additionally, normalizeEndpointName is already imported from librechat-data-provider and should be added to the import on line 4.

Copilot uses AI. Check for mistakes.
Comment on lines +43 to +49
let dropParams = [];
if (endpoint && Array.isArray(endpoint.dropParams)) {
dropParams.push(...endpoint.dropParams);
if (dropParams.length > 0) {
result[endpoint.name] = dropParams;
}
}
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The intermediate dropParams array is unnecessary. The code creates an empty array, spreads endpoint.dropParams into it, then checks if it has length. Since endpoint.dropParams is already verified to be an array on line 44, you can simplify this to directly use endpoint.dropParams and check its length:

if (endpoint && Array.isArray(endpoint.dropParams) && endpoint.dropParams.length > 0) {
  result[endpoint.name] = endpoint.dropParams;
}

Copilot uses AI. Check for mistakes.
/** @type {TStartupConfig} */
const payload = {
appTitle: process.env.APP_TITLE || 'LibreChat',
endpointsDropParamsMap: endpointsDropParamsMap,
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file uses shorthand property notation for other variables with matching names (e.g., emailLoginEnabled on line 107, sharedLinksEnabled on line 125, passwordResetEnabled on line 115). For consistency, this should use shorthand: endpointsDropParamsMap, instead of endpointsDropParamsMap: endpointsDropParamsMap,.

Copilot uses AI. Check for mistakes.

export type TStartupConfig = {
appTitle: string;
endpointsDropParamsMap?: Map<string, string []>;
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The TypeScript type Map<string, string[]> is incorrect here. The server constructs this as a plain JavaScript object (const result = {}) which gets serialized to JSON. JSON does not support Map — a Map serialized to JSON becomes {}. On the client side, the code accesses this via bracket notation (startupConfig?.endpointsDropParamsMap?.[conversation?.endpoint ?? '']), which works for plain objects but not for Map instances.

This should be Record<string, string[]> instead of Map<string, string[]> to correctly represent the runtime type after JSON deserialization.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants