LibreChat/client/src/hooks/Conversations
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
..
index.ts 🔍 refactor: Search & Message Retrieval (#6903) 2025-04-16 21:07:43 -04:00
useBookmarkSuccess.ts 🔖 feat: Enhance Bookmarks UX, add RBAC, toggle via librechat.yaml (#3747) 2024-08-22 17:09:05 -04:00
useDebouncedInput.ts 🔧 fix: Apply Mongoose Plugin at Model Creation (#7749) 2025-06-04 23:11:34 -04:00
useDefaultConvo.ts 🎨 feat: UI Refresh for Enhanced UX (#6346) 2025-03-25 18:50:58 -04:00
useExportConversation.ts 🛡️ fix: Improve Error Handling and Null Safety in SSE Event Processing (#10751) 2025-12-01 14:05:50 -05:00
useGenerateConvo.ts 📂 refactor: Cleanup File Filtering Logic, Improve Validation (#10414) 2025-11-10 19:05:30 -05:00
useGetSender.ts 🛂 feat: OpenID Logout Redirect to end_session_endpoint (#5626) 2025-02-03 10:53:04 -05:00
useNavigateToConvo.tsx 🎯 refactor: Centralize Agent Model Handling Across Conversation Lifecycle (#10956) 2025-12-13 08:29:15 -05:00
useParameterEffects.ts 🎨 style: parameters panel update (#4780) 2024-11-22 19:10:03 -05:00
usePresetIndexOptions.ts 🪦 refactor: Remove Legacy Code (#10533) 2025-12-11 16:36:12 -05:00
usePresets.ts 🎛️ feat: Better Preset Menu Accessibility (#10734) 2025-12-11 16:37:14 -05:00
useSearchEnabled.ts 📌 fix: Pin Agents and Models (#10808) 2025-12-11 16:38:39 -05:00
useSetIndexOptions.ts 🪦 refactor: Remove Legacy Code (#10533) 2025-12-11 16:36:12 -05:00
useUpdateTagsInConvo.ts 🏷️ chore: Add Missing Localizations for Agents, Categories, Bookmarks (#9266) 2025-08-25 13:54:13 -04:00