LibreChat/client/src/hooks
Danny Avila fbaf7d1a6c
🗂️ feat: Better Persistence for Code Execution Files Between Sessions (#11362)
* refactor: process code output files for re-use (WIP)

* feat: file attachment handling with additional metadata for downloads

* refactor: Update directory path logic for local file saving based on basePath

* refactor: file attachment handling to support TFile type and improve data merging logic

* feat: thread filtering of code-generated files

- Introduced parentMessageId parameter in addedConvo and initialize functions to enhance thread management.
- Updated related methods to utilize parentMessageId for retrieving messages and filtering code-generated files by conversation threads.
- Enhanced type definitions to include parentMessageId in relevant interfaces for better clarity and usage.

* chore: imports/params ordering

* feat: update file model to use messageId for filtering and processing

- Changed references from 'message' to 'messageId' in file-related methods for consistency.
- Added messageId field to the file schema and updated related types.
- Enhanced file processing logic to accommodate the new messageId structure.

* feat: enhance file retrieval methods to support user-uploaded execute_code files

- Added a new method `getUserCodeFiles` to retrieve user-uploaded execute_code files, excluding code-generated files.
- Updated existing file retrieval methods to improve filtering logic and handle edge cases.
- Enhanced thread data extraction to collect both message IDs and file IDs efficiently.
- Integrated `getUserCodeFiles` into relevant endpoints for better file management in conversations.

* chore: update @librechat/agents package version to 3.0.78 in package-lock.json and related package.json files

* refactor: file processing and retrieval logic

- Added a fallback mechanism for download URLs when files exceed size limits or cannot be processed locally.
- Implemented a deduplication strategy for code-generated files based on conversationId and filename to optimize storage.
- Updated file retrieval methods to ensure proper filtering by messageIds, preventing orphaned files from being included.
- Introduced comprehensive tests for new thread data extraction functionality, covering edge cases and performance considerations.

* fix: improve file retrieval tests and handling of optional properties

- Updated tests to safely access optional properties using non-null assertions.
- Modified test descriptions for clarity regarding the exclusion of execute_code files.
- Ensured that the retrieval logic correctly reflects the expected outcomes for file queries.

* test: add comprehensive unit tests for processCodeOutput functionality

- Introduced a new test suite for the processCodeOutput function, covering various scenarios including file retrieval, creation, and processing for both image and non-image files.
- Implemented mocks for dependencies such as axios, logger, and file models to isolate tests and ensure reliable outcomes.
- Validated behavior for existing files, new file creation, and error handling, including size limits and fallback mechanisms.
- Enhanced test coverage for metadata handling and usage increment logic, ensuring robust verification of file processing outcomes.

* test: enhance file size limit enforcement in processCodeOutput tests

- Introduced a configurable file size limit for tests to improve flexibility and coverage.
- Mocked the `librechat-data-provider` to allow dynamic adjustment of file size limits during tests.
- Updated the file size limit enforcement test to validate behavior when files exceed specified limits, ensuring proper fallback to download URLs.
- Reset file size limit after tests to maintain isolation for subsequent test cases.
2026-01-22 10:01:44 -05:00
..
Agents 🦥 feat: Add Deferred Tools as Agents Capability (#11295) 2026-01-22 10:01:42 -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: Display name logic in Parallel Responses (#11149) 2025-12-29 21:42:21 -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: Improve UX for Parallel Streams (Multi-Convo) (#11096) 2025-12-25 01:43:54 -05:00
Files 🪜 fix: Layering Conflicts and UX Polish (#11177) 2026-01-02 11:43:03 -05:00
Generic 🪄 refactor: UI Polish and Admin Dialog Unification (#11108) 2025-12-28 11:01:25 -05:00
Input 🔊 refactor: Audio Chunk Handling for STT (#11140) 2025-12-29 11:32:17 -05:00
MCP 🧹 fix: MCP Panel Regressions after UI refactor (#11312) 2026-01-12 19:01:45 -05:00
Mermaid 📊 feat: Render Inline Mermaid Diagrams (#11112) 2025-12-26 19:53:06 -05:00
Messages ⏸ refactor: Improve UX for Parallel Streams (Multi-Convo) (#11096) 2025-12-25 01:43:54 -05:00
Nav 🪄 refactor: UI Polish and Admin Dialog Unification (#11108) 2025-12-28 11:01:25 -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 🔧 refactor: Permission handling for Resource Sharing (#11283) 2026-01-10 14:02:56 -05:00
SSE 🗂️ feat: Better Persistence for Code Execution Files Between Sessions (#11362) 2026-01-22 10:01:44 -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: Render Inline Mermaid Diagrams (#11112) 2025-12-26 19:53:06 -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 🔧 fix: Add hasAgentAccess to dependencies in useNewConvo hook (#11427) 2026-01-20 14:45:27 -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