Skip to content

🐛 fix: Stop guessing URL fields from key names in config form#38

Merged
danny-avila merged 1 commit intomainfrom
fix/config-endpoint-url-heuristic
May 3, 2026
Merged

🐛 fix: Stop guessing URL fields from key names in config form#38
danny-avila merged 1 commit intomainfrom
fix/config-endpoint-url-heuristic

Conversation

@dustinhealy
Copy link
Copy Markdown
Contributor

@dustinhealy dustinhealy commented Apr 26, 2026

Summary

Capital letters cannot be typed into the modelSpec preset endpoint field, only lowercase works, Shift-letter is swallowed. Makes valid endpoint values like openAI, azureOpenAI, azureAssistants impossible to enter from the admin panel.

FieldRenderer was inferring URL-ness from a substring match on the field key (url, endpoint). The 'endpoint' substring matched modelSpecs.list[].preset.endpoint — a categorical enum (openAI, anthropic, etc.), not a URL. The form rendered it as <input type="url">, and browser autofill on URL-typed inputs swallowed shifted keystrokes.

Fix:

  • Drop the keyword heuristic entirely. LibreChat's configSchema declares zero .url() validations today, so no field in the form should be rendered as type="url". If the schema ever tags a field with .url(), detection can be added at the schema-extraction layer (extractSchemaTree in src/server/config.ts) at that point.

Change Type

  • Bug fix (non-breaking change which fixes an issue)

Testing

  • Manually verified: typing openAI in Configuration → Model specs → list[0] → Preset → Endpoint now produces openAI (capital A registers).
  • Existing URL-keyed fields (baseURL, iconURL, searxngInstanceUrl, etc.) lose their placeholder="https://..." and type="url" rendering — they're plain text inputs now. Cosmetic only; no validation change because the schema didn't enforce URL-ness in the first place.
  • bun run lint clean. bunx tsc --noEmit clean. 528/528 tests pass.

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • My changes do not introduce new warnings
  • Local unit tests pass with my changes

The admin panel's text-field renderer was inferring URL-ness from a
substring match on the field key (`url`, `endpoint`). The `endpoint`
substring matched the modelSpec preset `endpoint` field — which is a
categorical enum like `openAI`, not a URL. Rendering it as
`<input type="url">` triggered browser autofill that swallowed
uppercase keystrokes, making `openAI` and other camel-cased endpoint
values impossible to type.

Removes the keyword heuristic outright. LibreChat's configSchema today
declares zero `.url()` validations, so no field in the form should be
rendered as `type="url"`. If the schema ever tags a field with `.url()`,
detection can be added at the schema-extraction layer at that point.

Linear: AI-895
@dustinhealy dustinhealy marked this pull request as ready for review April 26, 2026 05:29
@dustinhealy dustinhealy self-assigned this Apr 26, 2026
@dustinhealy dustinhealy added the bug Something isn't working label Apr 26, 2026
@danny-avila
Copy link
Copy Markdown
Contributor

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danny-avila danny-avila merged commit 7b7de06 into main May 3, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants