LibreChat/api/server
Joseph Licata 5cf50dd15e
🔦 fix: Tool resource files not visible in event-driven mode (#11610)
* fix: Execute code files not visible in event-driven mode

Fixes regression from #11588 where primeResources became non-mutating
but callers weren't updated to use returned values.

Changes:
- Add tool_resources to InitializedAgent type and return object
- Prime execute_code files in loadToolDefinitionsWrapper
- Pass tool_resources to loadToolDefinitionsWrapper
- Capture and return toolContextMap from loadToolsForExecution

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* refactor: Reorganize imports and enhance tool loading logic in ToolService.js

- Moved domainSeparatorRegex declaration to a more appropriate location for clarity.
- Reorganized import statements for better readability and maintainability.
- Removed unused variables and streamlined the loadToolsForExecution function by eliminating the regularToolContextMap, improving performance and code clarity.
- Updated loadActionToolsForExecution to ensure consistent handling of domain separator regex.

This refactor improves the overall structure and efficiency of the ToolService module.

* fix: file search tool priming in loadToolDefinitionsWrapper

- Added functionality to prime file search tools within the loadToolDefinitionsWrapper function, enhancing the tool context map for event-driven mode.
- Implemented error handling for the file search priming process to improve robustness and logging.
- Updated the tool context map to include the newly primed file search tool, ensuring it is available for subsequent operations.

This enhancement improves the tool loading capabilities by incorporating file search tools, facilitating better integration and functionality in the application.

* chore: import order

* refactor: Update agent initialization structure for improved clarity and functionality

- Rearranged properties in the InitializedAgent object to enhance readability and maintainability.
- Moved toolRegistry to the correct position and ensured tools and attachments are set appropriately.
- This refactor improves the overall structure of the agent initialization process, facilitating better integration and future enhancements.

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Danny Avila <danny@librechat.ai>
2026-02-04 10:11:47 +01:00
..
controllers 📉 feat: Add Token Usage Tracking for Agents API Routes (#11600) 2026-02-01 21:36:51 -05:00
middleware 🛸 feat: Remote Agent Access with External API Support (#11503) 2026-01-28 17:44:33 -05:00
routes 🛸 feat: Remote Agent Access with External API Support (#11503) 2026-01-28 17:44:33 -05:00
services 🔦 fix: Tool resource files not visible in event-driven mode (#11610) 2026-02-04 10:11:47 +01:00
utils feat: Add Claude conversation importer with thinking support (#11124) 2025-12-29 21:37:52 -05:00
cleanup.js ⏸ refactor: Improve UX for Parallel Streams (Multi-Convo) (#11096) 2025-12-25 01:43:54 -05:00
experimental.js 🛸 feat: Remote Agent Access with External API Support (#11503) 2026-01-28 17:44:33 -05:00
index.js 🛸 feat: Remote Agent Access with External API Support (#11503) 2026-01-28 17:44:33 -05:00
index.spec.js 🚦 refactor: Concurrent Request Limiter for Resumable Streams (#11167) 2026-01-01 11:10:56 -05:00
socialLogins.js 🍪 refactor: Secure Cookie Setting for Localhost OAuth Sessions (#11518) 2026-01-26 11:28:50 -05:00