LibreChat/client/src/Providers
Danny Avila 2ac62a2e71
Some checks are pending
Docker Dev Branch Images Build / build (Dockerfile, lc-dev, node) (push) Waiting to run
Docker Dev Branch Images Build / build (Dockerfile.multi, lc-dev-api, api-build) (push) Waiting to run
Docker Dev Images Build / build (Dockerfile, librechat-dev, node) (push) Waiting to run
Docker Dev Images Build / build (Dockerfile.multi, librechat-dev-api, api-build) (push) Waiting to run
Sync Locize Translations & Create Translation PR / Sync Translation Keys with Locize (push) Waiting to run
Sync Locize Translations & Create Translation PR / Create Translation PR on Version Published (push) Blocked by required conditions
fix: Resolve Agent Provider Endpoint Type for File Upload Support (#12117)
* chore: Remove unused setValueOnChange prop from MCPServerMenuItem component

* fix: Resolve agent provider endpoint type for file upload support

When using the agents endpoint with a custom provider (e.g., Moonshot),
the endpointType was resolving to "agents" instead of the provider's
actual type ("custom"), causing "Upload to Provider" to not appear in
the file attach menu.

Adds `resolveEndpointType` utility in data-provider that follows the
chain: endpoint (if not agents) → agent.provider → agents. Applied
consistently across AttachFileChat, DragDropContext, useDragHelpers,
and AgentPanel file components (FileContext, FileSearch, Code/Files).

* refactor: Extract useAgentFileConfig hook, restore deleted tests, fix review findings

- Extract shared provider resolution logic into useAgentFileConfig hook
  (Finding #2: DRY violation across FileContext, FileSearch, Code/Files)
- Restore 18 deleted test cases in AttachFileMenu.spec.tsx covering
  agent capabilities, SharePoint, edge cases, and button state
  (Finding #1: accidental test deletion)
- Wrap fileConfigEndpoint in useMemo in AttachFileChat (Finding #3)
- Fix misleading test name in AgentFileConfig.spec.tsx (Finding #4)
- Fix import order in FileSearch.tsx, FileContext.tsx, Code/Files.tsx (Finding #5)
- Add comment about cache gap in useDragHelpers (Finding #6)
- Clarify resolveEndpointType JSDoc (Finding #7)

* refactor: Memoize Footer component for performance optimization

- Converted Footer component to a memoized version to prevent unnecessary re-renders.
- Improved import structure by adding memo to the React import statement for clarity.

* chore: Fix remaining review nits

- Widen useAgentFileConfig return type to EModelEndpoint | string
- Fix import order in FileContext.tsx and FileSearch.tsx
- Remove dead endpointType param from setupMocks in AttachFileMenu test

* fix: Pass resolved provider endpoint to file upload validation

AgentPanel file components (FileContext, FileSearch, Code/Files) were
hardcoding endpointOverride to "agents", causing both client-side
validation (file limits, MIME types) and server-side validation to
use the agents config instead of the provider-specific config.

Adds endpointTypeOverride to UseFileHandling params so endpoint and
endpointType can be set independently. Components now pass the
resolved provider name and type from useAgentFileConfig, so the full
fallback chain (provider → custom → agents → default) applies to
file upload validation on both client and server.

* test: Verify any custom endpoint is document-supported regardless of name

Adds parameterized tests with arbitrary endpoint names (spaces, hyphens,
colons, etc.) confirming that all custom endpoints resolve to
document-supported through resolveEndpointType, both as direct
endpoints and as agent providers.

* fix: Use || for provider fallback, test endpointOverride wiring

- Change providerValue ?? to providerValue || so empty string is
  treated as "no provider" consistently with resolveEndpointType
- Add wiring tests to CodeFiles, FileContext, FileSearch verifying
  endpointOverride and endpointTypeOverride are passed correctly
- Update endpointOverride JSDoc to document endpointType fallback
2026-03-07 10:45:43 -05:00
..
__tests__ fix: Resolve Agent Provider Endpoint Type for File Upload Support (#12117) 2026-03-07 10:45:43 -05:00
ActivePanelContext.tsx 🔒 fix: Agents Config/Permission Checks after Streamline Change (#8089) 2025-06-26 18:53:05 -04:00
AddedChatContext.tsx ⏸ refactor: Improve UX for Parallel Streams (Multi-Convo) (#11096) 2025-12-25 01:43:54 -05:00
AgentPanelContext.tsx 🏗️ feat: Dynamic MCP Server Infrastructure with Access Control (#10787) 2025-12-11 16:38:37 -05:00
AgentsContext.tsx feat: Agent Panel UI Enhancements (#7800) 2025-06-13 15:47:41 -04:00
AgentsMapContext.tsx 🚧 chore: merge latest dev build to main repo (#3844) 2024-08-31 16:33:51 -04:00
AnnouncerContext.tsx v0.7.5-rc2 (#3976) 2024-09-10 19:00:27 -04:00
ArtifactContext.tsx 🚀 feat: Artifact Editing & Downloads (#5428) 2025-01-23 18:19:04 -05:00
ArtifactsContext.tsx refactor: Optimize Message Re-renders (#12097) 2026-03-06 00:03:32 -05:00
AssistantsContext.tsx feat: Assistants API, General File Support, Side Panel, File Explorer (#1696) 2024-02-13 20:42:27 -05:00
AssistantsMapContext.tsx feat: Assistants API, General File Support, Side Panel, File Explorer (#1696) 2024-02-13 20:42:27 -05:00
BadgeRowContext.tsx 🗂️ refactor: Artifacts via Model Specs & Scope Badge Persistence by Spec Context (#11796) 2026-02-14 13:56:50 -05:00
BookmarkContext.tsx 🔖 feat: Conversation Bookmarks (#3344) 2024-07-29 10:45:59 -04:00
ChatContext.tsx 🌿 feat: Multi-response Streaming (#3191) 2024-06-25 03:02:38 -04:00
ChatFormContext.tsx 🗨️ feat: Prompts (#3131) 2024-06-20 20:24:32 -04:00
CodeBlockContext.tsx 🚀 feat: Artifact Editing & Downloads (#5428) 2025-01-23 18:19:04 -05:00
CustomFormContext.tsx 🗨️ feat: Prompts (#3131) 2024-06-20 20:24:32 -04:00
DashboardContext.tsx 🗨️ feat: Prompts (#3131) 2024-06-20 20:24:32 -04:00
DragDropContext.tsx fix: Resolve Agent Provider Endpoint Type for File Upload Support (#12117) 2026-03-07 10:45:43 -05:00
EditorContext.tsx feat: Artifact Management Enhancements, Version Control, and UI Refinements (#10318) 2025-11-12 13:32:47 -05:00
FileMapContext.tsx feat: Assistants API, General File Support, Side Panel, File Explorer (#1696) 2024-02-13 20:42:27 -05:00
index.ts 🏗️ feat: Dynamic MCP Server Infrastructure with Access Control (#10787) 2025-12-11 16:38:37 -05:00
MessageContext.tsx 🎋 refactor: Improve Message UI State Handling (#9678) 2025-09-17 13:07:56 -04:00
MessagesViewContext.tsx refactor: Optimize Message Re-renders (#12097) 2026-03-06 00:03:32 -05:00
PromptGroupsContext.tsx 🗨️ refactor: Only Allow Prompt Queries with Access (#9688) 2025-09-18 10:00:33 -04:00
SearchContext.tsx 🔎 feat: Native Web Search with Citation References (#7516) 2025-05-23 17:40:40 -04:00
SetConvoContext.tsx ♻️ refactor: Logout UX, Improved State Teardown, & Remove Unused Code (#5292) 2025-01-12 12:57:10 -05:00
ShareContext.tsx 🚀 feat: Shared Links (#2772) 2024-05-17 18:13:32 -04:00
SidePanelContext.tsx ♻️ refactor: SidePanel Context to Optimize on ChatView Rerender (#8509) 2025-07-17 11:31:19 -04:00
ToolCallsMapContext.tsx 🎉 feat: Code Interpreter API and Agents Release (#4860) 2024-12-04 15:48:13 -05:00