LibreChat/client/src/hooks/Input
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 📦 feat: Move Shared Components to @librechat/client (#8685) 2025-07-27 12:19:01 -04:00
useAutoSave.ts 📝 fix: Prevent Deletion of User Input During AI Generation (#9719) 2025-09-19 13:19:38 -04:00
useDebounce.ts fix: Ensure Message Send Requires Key 🔑 (#1281) 2023-12-05 09:38:04 -05:00
useGetAudioSettings.ts 🔀 refactor: Modularize TTS Logic for Improved Browser support (#3657) 2024-08-15 11:34:25 -04:00
useHandleKeyUp.ts feat: Quality-of-Life Chat/Edit-Message Enhancements (#5194) 2025-01-06 22:47:24 -05:00
useMentions.ts 🦾 refactor: filter Model Specs based on user access to Agents (#9433) 2025-09-03 02:59:57 -04:00
useMultipleKeys.ts feat: Google Gemini ❇️ (#1355) 2023-12-15 02:18:07 -05:00
useQueryParams.spec.ts 🎯 refactor: Centralize Agent Model Handling Across Conversation Lifecycle (#10956) 2025-12-13 08:29:15 -05:00
useQueryParams.ts 🎯 refactor: Centralize Agent Model Handling Across Conversation Lifecycle (#10956) 2025-12-13 08:29:15 -05:00
useRequiresKey.ts 📂 refactor: Cleanup File Filtering Logic, Improve Validation (#10414) 2025-11-10 19:05:30 -05:00
useSelectMention.ts 🎯 refactor: Centralize Agent Model Handling Across Conversation Lifecycle (#10956) 2025-12-13 08:29:15 -05:00
useSpeechToText.ts 🎯 fix: Prevent UI De-sync By Removing Redundant States (#5333) 2025-01-16 17:38:59 -05:00
useSpeechToTextBrowser.ts 📦 feat: Move Shared Components to @librechat/client (#8685) 2025-07-27 12:19:01 -04:00
useSpeechToTextExternal.ts 🗣️ feat: Language Support for OpenAI Speech-to-Text (#9470) 2025-09-05 12:01:00 -04:00
useTextarea.ts 📦 feat: Move Shared Components to @librechat/client (#8685) 2025-07-27 12:19:01 -04:00
useTextToSpeech.ts 👋 feat: remove Edge TTS (#6885) 2025-04-14 22:39:01 -04:00
useTextToSpeechBrowser.ts fix(useTextToSpeechBrowser): handle undefined window.speechSynthesis on some android devices 2024-08-16 02:49:59 -04:00
useTextToSpeechExternal.ts 📦 feat: Move Shared Components to @librechat/client (#8685) 2025-07-27 12:19:01 -04:00
useUserKey.ts 🪦 refactor: Remove Legacy Code (#10533) 2025-12-11 16:36:12 -05:00