LibreChat/client/src/hooks
Danny Avila b5ab32c5ae
🎯 refactor: Centralize Agent Model Handling Across Conversation Lifecycle (#10956)
* refactor: Implement clearModelForNonEphemeralAgent utility for improved agent handling

- Introduced clearModelForNonEphemeralAgent function to manage model state for non-ephemeral agents across various components.
- Updated ModelSelectorContext to initialize model based on agent type.
- Enhanced useNavigateToConvo, useQueryParams, and useSelectMention hooks to clear model for non-ephemeral agents.
- Refactored buildDefaultConvo and endpoints utility to ensure proper handling of agent_id and model state.
- Improved overall conversation logic and state management for better performance and reliability.

* refactor: Enhance useNewConvo hook to improve agent conversation handling

- Added logic to skip access checks for existing agent conversations, utilizing localStorage to restore conversations after refresh.
- Improved handling of default endpoints for agents based on user access and existing conversation state, ensuring more reliable conversation initialization.

* refactor: Update ChatRoute and useAuthRedirect to include user roles

- Enhanced ChatRoute to utilize user roles for improved conversation state management.
- Modified useAuthRedirect to return user roles alongside authentication status, ensuring roles are available for conditional logic in ChatRoute.
- Adjusted conversation initialization logic to depend on the loaded roles, enhancing the reliability of the conversation setup.

* refactor: Update BaseClient to handle non-ephemeral agents in conversation logic

- Added a check for non-ephemeral agents in BaseClient, modifying the exceptions set to include 'model' when applicable.
- Enhanced conversation handling to improve flexibility based on agent type.

* test: Add mock for clearModelForNonEphemeralAgent in useQueryParams tests

- Introduced a mock for clearModelForNonEphemeralAgent to enhance testing of query parameters related to non-ephemeral agents.
- This addition supports improved test coverage and ensures proper handling of model state in relevant scenarios.

* refactor: Simplify mocks in useQueryParams tests for improved clarity

- Updated the mocking strategy for utilities in useQueryParams tests to use actual implementations where possible, while still suppressing test output for the logger.
- Enhanced the mock for tQueryParamsSchema to minimize complexity and avoid unnecessary validation during tests, improving test reliability and maintainability.

* refactor: Enhance agent identification logic in BaseClient for improved clarity

* chore: Import Constants in families.ts for enhanced functionality
2025-12-13 08:29:15 -05:00
..
Agents 🧩 refactor: Decouple MCP Config from Startup Config (#10689) 2025-12-11 16:36:34 -05:00
Artifacts feat: Artifact Management Enhancements, Version Control, and UI Refinements (#10318) 2025-11-12 13:32:47 -05:00
Assistants 📢 fix: Invalid engineTTS and Conversation State on Navigation (#6904) 2025-04-15 21:00:06 -04:00
Audio 👋 feat: remove Edge TTS (#6885) 2025-04-14 22:39:01 -04:00
Chat 🪦 refactor: Remove Legacy Code (#10533) 2025-12-11 16:36:12 -05:00
Config 🧩 refactor: Decouple MCP Config from Startup Config (#10689) 2025-12-11 16:36:34 -05:00
Conversations 🎯 refactor: Centralize Agent Model Handling Across Conversation Lifecycle (#10956) 2025-12-13 08:29:15 -05:00
Endpoint 🪦 refactor: Remove Legacy Code (#10533) 2025-12-11 16:36:12 -05:00
Files 📂 refactor: Cleanup File Filtering Logic, Improve Validation (#10414) 2025-11-10 19:05:30 -05:00
Generic ⌨️ feat: Add Shift-Key Shortcuts for Instant Conversation Actions (#10732) 2025-12-11 16:38:23 -05:00
Input 🎯 refactor: Centralize Agent Model Handling Across Conversation Lifecycle (#10956) 2025-12-13 08:29:15 -05:00
MCP 📦 chore: Bump MCP SDK: Fix Types and MCP OAuth due to Update (#10811) 2025-12-11 16:38:40 -05:00
Messages 💻 feat: Deeper MCP UI integration in the Chat UI (#9669) 2025-12-11 16:41:11 -05:00
Nav 🔧 fix: Show MCP Builder panel for users with CREATE permission even when no servers exist (#10887) 2025-12-11 16:39:32 -05:00
Plugins 🪦 refactor: Remove Legacy Code (#10533) 2025-12-11 16:36:12 -05:00
Prompts 🗨️ refactor: Only Allow Prompt Queries with Access (#9688) 2025-09-18 10:00:33 -04:00
Roles 🪺 refactor: Nest Permission fields for Roles (#6487) 2025-04-04 19:47:14 -04:00
Sharing 🏗️ feat: Dynamic MCP Server Infrastructure with Access Control (#10787) 2025-12-11 16:38:37 -05:00
SSE 🪦 refactor: Remove Legacy Code (#10533) 2025-12-11 16:36:12 -05:00
ApiErrorBoundaryContext.tsx 🌎 i18n: React-i18next & i18next Integration (#5720) 2025-02-09 12:05:31 -05:00
AuthContext.tsx fix: Debounce setUserContext and Default State Param for OpenID Auth (#7559) 2025-05-25 23:40:37 -04:00
index.ts 💻 feat: Deeper MCP UI integration in the Chat UI (#9669) 2025-12-11 16:41:11 -05:00
ScreenshotContext.tsx 🌒 refactor: Theme Handling to use isDark Utility (#9405) 2025-09-03 02:56:36 -04:00
useChatBadges.ts 🖥️ feat: Code Interpreter API for Non-Agent Endpoints (#6803) 2025-04-09 16:11:16 -04:00
useDocumentTitle.ts refactor: Settings/Presets UI Restructure, convert many files to TS (#740) 2023-08-04 13:56:44 -04:00
useFavorites.ts 📌 feat: Pin Agents and Models in the Sidebar (#10634) 2025-12-11 16:38:20 -05:00
useGenerationsByLatest.ts 🪦 refactor: Remove Legacy Code (#10533) 2025-12-11 16:36:12 -05:00
useInfiniteScroll.ts 🪟 fix: Auto-fetch agents to fill Viewport in Marketplace Scroll (#9591) 2025-09-12 10:59:15 -04:00
useLocalize.ts 💸 feat: Balance Tab in Settings Dialog (#6537) 2025-05-29 08:25:37 -04:00
useLocalizedConfig.ts ⚙️ feat: Add configurable trust checkbox labels for MCP Server Dialog (#10820) 2025-12-11 16:38:40 -05:00
useLocalStorage.tsx refactor: Encrypt & Expire User Provided Keys, feat: Rate Limiting (#874) 2023-09-06 10:46:27 -04:00
useLocalStorageAlt.tsx 🔧 fix: MCP Selection Persist and UI Flicker Issues (#9324) 2025-08-28 00:44:49 -04:00
useNewConvo.ts 🎯 refactor: Centralize Agent Model Handling Across Conversation Lifecycle (#10956) 2025-12-13 08:29:15 -05:00
usePersonalizationAccess.ts 🧠 feat: User Memories for Conversational Context (#7760) 2025-06-07 18:52:22 -04:00
useResourcePermissions.ts 💻 feat: Deeper MCP UI integration in the Chat UI (#9669) 2025-12-11 16:41:11 -05:00
useScrollToRef.ts feat: Optimize Scroll Handling with Intersection Observer (#3564) 2024-08-06 16:18:15 -04:00
useTimeout.tsx 🔧 fix: URL params, package mismatch, typing, shared link redirect, and o1 (azure) (#4899) 2024-12-07 16:55:17 -05:00
useVirtualGrid.ts 🖼️ style: Improve Marketplace & Sharing Dialog UI 2025-08-13 16:24:24 -04:00
useWakeLock.ts feat: Prevent Screen Sleep During Response Generation (#10597) 2025-11-21 09:14:32 -05:00