Skip to content

✨ feat: Infer Reasoning Effort Support From Known Custom Endpoint Hosts - #16797

Open
berry-13 wants to merge 3 commits into
devfrom
feat/host-implied-reasoning-effort
Open

berry-13 wants to merge 3 commits into
devfrom
feat/host-implied-reasoning-effort

Conversation

@berry-13

@berry-13 berry-13 commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

A custom endpoint pointed at a known provider (OpenRouter, xAI, OpenAI) never showed the composer reasoning effort control unless librechat.yaml declared customParams for it. The client treats custom endpoints as definition-driven because their model catalogs belong to the deployment, so without a reasoningFormat, a reasoning paramDefinitions entry or a known defaultParamsEndpoint it resolves no reasoning setting at all.

loadCustomEndpointsConfig now declares reasoningFormat: reasoning_effort for an endpoint whose baseURL host is OpenRouter, xAI or OpenAI. The composer, the send path and the server-side override validation already read customParams.reasoningFormat, so all three pick it up with no client change. The match is on the base URL host only, never the endpoint name or icon, so a local server named "xAI" gets nothing.

Anything the admin configured wins: a native provider, a non-default defaultParamsEndpoint, any reasoningFormat (including disabled, which still hides the control), or a reasoning paramDefinitions entry. Hosts whose request shape I could not confirm (Groq, Deepseek, Mistral) are deliberately left out and covered by a test.

Type of change

  • Feature

Testing

Tested environments/configuration:

Custom endpoint configs only, exercised through loadCustomEndpointsConfig. Not run against a live provider or in a browser.

Automated tests:

Added cases to packages/api/src/endpoints/custom/config.spec.ts: known hosts get reasoning_effort; a name or icon alone does not; Groq and Mistral hosts do not; an explicit reasoningFormat, reasoning paramDefinitions, non-default defaultParamsEndpoint or native provider is left untouched. The host case failed first with Expected: "reasoning_effort", Received: undefined. Passing after the change: config.spec.ts and providers.spec.ts (32 tests), parameterSettings.spec.ts (45 tests). lc lint is clean and tsc --noEmit passes in packages/api and packages/data-provider.

Screenshots / recordings

Not captured. The effort control now appears for these endpoints, but it was not checked in a running app.

Risk / compatibility

Every custom endpoint on those hosts now shows the control by default, with no new config field; reasoningFormat: disabled is the existing way to turn it off. The flat reasoning_effort shape for xAI is based on secondary sources, not xAI's own documentation, and was not tested against a live API. Endpoints on other hosts, and self-hosted ones, still need customParams.

Checklist

  • I reviewed my own changes
  • Relevant tests have been added or updated
  • Existing relevant tests pass
  • The change does not introduce new warnings or errors
  • Required dependency changes have been merged/published
  • Required documentation PR: N/A

Copilot AI balanced review requested due to automatic review settings October 5, 2026 22:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-05T22:42:28.586149Z 427c674 New commits
🔒 Security Review ✅ Completed 2026-10-05T22:27:46.848368Z 1ab2bda PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1ab2bda818

ℹ️ 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".

Comment thread packages/api/src/endpoints/custom/config.ts
Comment thread packages/api/src/endpoints/custom/config.ts
Comment thread packages/api/src/endpoints/custom/config.ts Outdated
Comment thread packages/api/src/endpoints/custom/config.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f509704622

ℹ️ 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".

Comment thread packages/api/src/endpoints/custom/config.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 427c6749f4

ℹ️ 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".

Comment thread packages/api/src/endpoints/custom/config.ts
@berry-13
berry-13 added this pull request to stack #16846 October 6, 2026 20:31
@codegraph-librechat codegraph-librechat Bot added the 🗺️ Backend Infra codegraph: the taxonomy area this belongs to (classifier, confidence ≥ 0.9) label Oct 6, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🗺️ Backend Infra codegraph: the taxonomy area this belongs to (classifier, confidence ≥ 0.9)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants