-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
⚡ refactor: DocumentDB Compatibility for Balance Updates #6673
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…Transaction model to allow for documentdb compatibility
jmaddington
referenced
this pull request
in jmaddington/LibreChat
Apr 2, 2025
Builds locally, merging. * 🧠 feat: Reasoning UI for Agents (#5904) * chore: bump https-proxy-agent and @librechat/agents * refactor: Improve error logging in OllamaClient for API fetch failures * feat: Add DeepSeek provider support and enhance provider name handling * refactor: Use Providers.OLLAMA constant for model name check in fetchModels function * feat: Enhance formatAgentMessages to handle reasoning content type * feat: OpenRouter Agent Reasoning * hard work and dedicationgit add .env.example :) * fix: Handle Google social login with missing last name Social login with Google was previously displaying 'undefined' when a user's last name was empty or not provided. Changes: - Conditionally render last name only if it exists - Prevent displaying 'undefined' when last name is missing * fix: add missing file endings for developers yml,yaml and log --------- Co-authored-by: Mohamed Al-Duraji <[email protected]> Co-authored-by: Deepak Kendole <[email protected]> Co-authored-by: Peter Rothlaender <[email protected]> * 🐞 fix: Add Null Checks for BaseURL in Agent Config (#5908) * ⚙️ refactor: Enhance Logging, Navigation And Error Handling (#5910) * refactor: Ensure Axios Errors are less Verbose if No Response * refactor: Improve error handling in logAxiosError function * fix: Prevent ModelSelect from rendering for Agent Endpoints * refactor: Enhance logging functions with type parameter for better clarity * refactor: Update buildDefaultConvo function to use optional endpoint parameter since we pass a default value for undefined * refactor: Replace console logs with logger warnings and errors in useNavigateToConvo hook, and handle removed endpoint edge case * chore: import order * ⚖️ docs: Update LICENSE.md Year: 2024 -> 2025 (#5915) * 🔒 feat: Two-Factor Authentication with Backup Codes & QR support (#5685) * 🔒 feat: add Two-Factor Authentication (2FA) with backup codes & QR support (#5684) * working version for generating TOTP and authenticate. * better looking UI * refactored + better TOTP logic * fixed issue with UI * fixed issue: remove initial setup when closing window before completion. * added: onKeyDown for verify and disable * refactored some code and cleaned it up a bit. * refactored some code and cleaned it up a bit. * refactored some code and cleaned it up a bit. * refactored some code and cleaned it up a bit. * fixed issue after updating to new main branch * updated example * refactored controllers * removed `passport-totp` not used. * update the generateBackupCodes function to generate 10 codes by default: * update the backup codes to an object. * fixed issue with backup codes not working * be able to disable 2FA with backup codes. * removed new env. replaced with JWT_SECRET * ✨ style: improved a11y and style for TwoFactorAuthentication * 🔒 fix: small types checks * ✨ feat: improve 2FA UI components * fix: remove unnecessary console log * add option to disable 2FA with backup codes * - add option to refresh backup codes - (optional) maybe show the user which backup codes have already been used? * removed text to be able to merge the main. * removed eng tx to be able to merge * fix: migrated lang to new format. * feat: rewrote whole 2FA UI + refactored 2FA backend * chore: resolving conflicts * chore: resolving conflicts * fix: missing packages, because of resolving conflicts. * fix: UI issue and improved a11y * fix: 2FA backup code not working * fix: update localization keys for UI consistency * fix: update button label to use localized text * fix: refactor backup codes regeneration and update localization keys * fix: remove outdated translation for shared links management * fix: remove outdated 2FA code prompts from translation.json * fix: add cursor styles for backup codes item based on usage state * fix: resolve conflict issue * fix: resolve conflict issue * fix: resolve conflict issue * fix: missing packages in package-lock.json * fix: add disabled opacity to the verify button in TwoFactorScreen * ⚙ fix: update 2FA logic to rely on backup codes instead of TOTP status * ⚙️ fix: Simplify user retrieval in 2FA logic by removing unnecessary TOTP secret query * ⚙️ test: Add unit tests for TwoFactorAuthController and twoFactorControllers * ⚙️ fix: Ensure backup codes are validated as an array before usage in 2FA components * ⚙️ fix: Update module path mappings in tests to use relative paths * ⚙️ fix: Update moduleNameMapper in jest.config.js to remove the caret from path mapping * ⚙️ refactor: Simplify import paths in TwoFactorAuthController and twoFactorControllers test files * ⚙️ test: Mock twoFactorService methods in twoFactorControllers tests * ⚙️ refactor: Comment out unused imports and mock setups in test files for two-factor authentication * ⚙️ refactor: removed files * refactor: Exclude totpSecret from user data retrieval in AuthController, LoginController, and jwtStrategy * refactor: Consolidate backup code verification to apply DRY and remove default array in user schema * refactor: Enhance two-factor authentication ux/flow with improved error handling and loading state management, prevent redirect to /login --------- Co-authored-by: Marco Beretta <[email protected]> Co-authored-by: Danny Avila <[email protected]> * 🛠 refactor: Ensure File Deletions, File Naming, and Agent Resource Updates (#5928) * refactor: Improve error logging for file upload and processing functions to prevent verbosity * refactor: Add uploads directory to Docker Compose to persist file uploads * refactor: `addAgentResourceFile` to handle edge case of non-existing `tool_resource` array * refactor: Remove version specification from deploy-compose.yml * refactor: Prefix filenames with file_id to ensure uniqueness in file uploads * refactor: Enhance error handling in deleteVectors to log warnings for non-404 errors * refactor: Limit file search results to top 5 based on relevance score * 🌍 i18n: Update translation.json with latest translations --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * 🐛 fix: RAG Results Sorted By Distance (#5931) * refactor: Extract file unlinking logic into a separate function and don't throw error * fix: RAG results are actually in distance, not score * 📜 ci: Automate`CHANGELOG.md` (#5838) * feat: started with automated CHANGELOG.md * fix: no `configuration.json` found * refactor: `configuration.json` * fix: missing label `configuration.json` * fix: missing label `configuration.json` * fix: missing label `configuration.json` * fix: missing label `configuration.json` * fix: missing label `configuration.json` * ci: test new workflow action * ci: test new workflow action * ci: test new workflow action * feat: working CHANGELOG.md generation * feat: working CHANGELOG.md generation * feat: working CHANGELOG.md generation * feat: working CHANGELOG.md generation * feat: working CHANGELOG.md generation * feat: working CHANGELOG.md generation * feat: working CHANGELOG.md generation * fix: separate release and Unreleased workflows CHANGELOG.md generation * fix: separate release and Unreleased workflows CHANGELOG.md generation * fix: separate release and Unreleased workflows CHANGELOG.md generation * fix: separate release and Unreleased workflows CHANGELOG.md generation * fix: separate release and Unreleased workflows CHANGELOG.md generation * fix: separate release and Unreleased workflows CHANGELOG.md generation * fix: separate release and Unreleased workflows CHANGELOG.md generation * fix: separate release and Unreleased workflows CHANGELOG.md generation * fix: separate release and Unreleased workflows CHANGELOG.md generation * fix: separate release and Unreleased workflows CHANGELOG.md generation * fix: separate release and Unreleased workflows CHANGELOG.md generation * fix: separate release and Unreleased workflows CHANGELOG.md generation * fix: separate release and Unreleased workflows CHANGELOG.md generation * fix: separate release and Unreleased workflows CHANGELOG.md generation * fix: separate release and Unreleased workflows CHANGELOG.md generation * fix: separate release and Unreleased workflows CHANGELOG.md generation * fix: separate release and Unreleased workflows CHANGELOG.md generation * fix: separate release and Unreleased workflows CHANGELOG.md generation * fix: separate release and Unreleased workflows CHANGELOG.md generation * fix: separate release and Unreleased workflows CHANGELOG.md generation * fix: separate release and Unreleased workflows CHANGELOG.md generation * fix: separate release and Unreleased workflows CHANGELOG.md generation * fix: separate release and Unreleased workflows CHANGELOG.md generation * refactor: only trigger the `unreleased-changelog` action on push to `main` and `generate-release-changelog` only when pushing a tag with `v*.*.*` * refactor: Runs only every Monday at 00:00 UTC * 🔒 fix: 2FA Encrypt TOTP Secrets & Improve Docs (#5933) * 🔒 fix: Integrate TOTP secret retrieval and encryption in Two-Factor Authentication * 🔒 refactor: Simplify TOTP verification by removing commented-out code * 🔧 fix: Resizable Panel Unmount Error & Code Env. File Re-Upload (#5947) * 🔧 refactor: handle full path for code env. file re-upload * fix: update react-resizable-panels to version 2.1.7 to resolve error thrown on unmount of artifacts; ref: https://github.com/bvaughn/react-resizable-panels/issues/372 * refactor: replace promptPrefix with systemMessage in GoogleClient for improved clarity, and to prevent saving LibreChat feature-specific instructions to the user's custom instructions * ✨ style: Enhance Styling & Accessibility (#5956) * ✨ feat: Enhance UI Components with Shadows and Accessibility Improvements * 🔧 fix: Correct Category Labels and Values in API Model & Adjust Button Class in Prompt List * 🔢 chore: Remove Dollar Sign from Balance Display (#5948) * 🚀 feat: Support Redis Clusters, Trusted Proxy Setting, And Toggle Meilisearch Indexing (#5963) * refactor: Improve MeiliSearch integration with environment-based configuration for running index sync * chore: Remove Question issue template from GitHub repository * feat: Enable indexing in MeiliSearch configuration and clean up error handling in indexSync * feat: Update .env.example to include optional indexing configuration * refactor: rename env var for disabling index sync to MEILI_NO_SYNC * Added the option to change the default trusted proxy * feat: Add TRUST_PROXY configuration to .env.example for reverse proxy settings * feat: Enhance Redis support with cluster configuration and TLS options * feat(redis): add cluster support, environment config and url mapping - Add Redis cluster configuration with isEnabled flag - Configure prefix and max listeners settings - Improve code formatting and readability - Fix URL vs host parameter handling - Update environment variables and regex patterns --------- Co-authored-by: Gil Assunção <[email protected]> Co-authored-by: Pedro Reis <[email protected]> Co-authored-by: João Trigo Soares <[email protected]> * 👐 refactor: Agents Accessibility and Gemini Error Handling (#5972) * style: Enhance ControlCombobox with Carat Display, ClassName, and Disabled State * refactor(ModelPanel): replace SelectDropdown with ControlCombobox for improved accessibility * style: Adjust padding and positioning in ModelPanel for improved layout * style(ControlCombobox): add containerClassName and iconSide props for enhanced customization * style(ControlCombobox): add iconClassName prop for customizable icon styling * refactor(AgentPanel): enhance layout with new button for creating agents and adjust structure for better alignment * refactor(AgentSelect): replace SelectDropDown with ControlCombobox for improved accessibility and layout * feat(translation): add new translation key for improved UI clarity * style(AgentSwitcher, AssistantSwitcher): add iconClassName prop for customizable icon styling * refactor(AgentPanelSkeleton): improve layout of skeleton components to match new visual structure * style(AgentPanel, AgentPanelSkeleton): add margin to flex container for improved layout consistency * a11y(AgentSelect, ControlCombobox): add selectId prop for preventing focus going to start to page after agent selection * fix(AgentSelect): update SELECT_ID constant for improved clarity in component identification * fix(GoogleClient): update type annotation, add abort handling for content generation requests, catch "uncaught" abort errors and GoogleGenerativeAI errors from `@google/generative-ai` * 🌍 i18n: Update translation.json with latest translations (#5946) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * ⚙️ ci: Trigger Restriction for `Detect Unused NPM Packages` (#5844) The workflow now only runs on pull requests that modify: - The root `package.json` or `package-lock.json` file - Any file under the client folder - Any file under the api folder * 🤖 feat: 192x192 Icon for Android PWA (#5966) * fix: Add 192x192 icon to allow the PWA to install on Android devices using Chrome. * fix: Use less whitespace on icon-192x192.png. Re-generate maskable-icon.png and apple-touch-icon-180x180.png to be higher quality, cripser and use less kilobytes. * 🌟 feat: Enhance User Experience and SEO with Accessibility Updates and robots.txt (#5392) * 🔈 fix: Refactor AudioRecorder to use button element for improved accessibility * 🔈 fix: Update conversation menu button ID for improved accessibility * 🔈 fix: Remove redundant role attribute from SidePanel for improved accessibility * feat: Add robots.txt to manage web crawler access * feat: Update index.html with meta description and remove legacy file * fix: resolve merge conflicts. * fix: resolve merge conflicts. * fix: resolve merge conflicts. * feat: Update index.html with meta description and remove legacy file * 🔧 feat: Add legacy support and improve SidePanel accessibility * 🔧 feat: Integrate express-static-gzip for improved static file serving and add new plugins for enhanced functionality * 🔧 chore: Remove unused HTML ESLint plugin configurations and dependencies --------- Co-authored-by: Ruben Talstra <[email protected]> * 🚀 feat: Add Custom Welcome Message in `librechat.yaml` (#5870) * feat: Custom Welcome Message (#2967) * don't think I'm on the right path? * ✨ feat: Implement custom welcome message configuration in interface * 🔼 feat: "Run Code" Button Toggle (#5988) * feat: Add 'Run Code' and 'Temporary Chat' permissions to role management * feat: Add NextFunction typedef to api/typedefs.js * feat: Add temporary chat and run code permissions to role schema * refactor: Enhance access check middleware with logging for permission errors and better typing * refactor: Set default value of USE permission to true in multiConvoPermissionsSchema * refactor: Implement checkAccess function for separation of permission validation logic from middleware * feat: Integrate permission checks for tool execution and enhance Markdown code block with execution capability * fix: Convert REDIS_MAX_LISTENERS to a number, closes #5979 * 🚀 feat: Claude 3.7 Support + Reasoning (#6008) * fix: missing console color methods for admin scripts * feat: Anthropic Claude 3.7 Sonnet Support * feat: update eventsource to version 3.0.2 and upgrade @modelcontextprotocol/sdk to 1.4.1 * fix: update DynamicInput to handle number type and improve initial value logic * feat: first pass Anthropic Reasoning (Claude 3.7) * feat: implement streaming support in AnthropicClient with reasoning UI handling * feat: add missing xAI (grok) models * 🔗 fix: Shared Link with Markdown Code Error (#6016) * refactor: Export AuthContext from AuthContextProvider * refactor: Update useHasAccess to utilize useContext for AuthContext * refactor: Enhance type definitions in useHasAccess for better type safety * sandbox sessions storage * sandbox sessions storage * 🌍 i18n: Add Georgian Language and Update Fallback Languages (#6022) * ✨ feat: Anthropic Agents Prompt Caching & UI Accessibility Enhancements (#6045) * chore: remove auto-focus for now * refactor: move react-hook-form Controller Logic to AgentSelect from AgentPanel * fix: a11y focus issue with AgentSelect by never replacing it in its component tree * fix: maintain ComboBox focus and force re-render on agent ID change in AgentPanel * chore: `gemini-2.0-flash-lite-preview-02-05` (deprecated) * refactor: extract cache control logic and headers configuration to helper functions in AnthropicClient * feat: anthropic agents prompt caching * chore: bump @librechat/agents and related dependencies * fix: typo * 🔧 refactor: Improve Params Handling, Remove Legacy Items, & Update Configs (#6074) * chore: include all assets for service worker, remove unused tsconfig.node.json, eslint ignore vite config * chore: exclude image files from service worker caching * refactor: simplify googleSchema transformation and error handling * fix: max output tokens cap for 3.7 models * fix: skip index fixing in CI, development, and test environments * ci: add maxOutputTokens handling tests for Claude models * refactor: drop top_k and top_p parameters for claude-3.7 in AnthropicClient and add tests for new behavior * refactor: conditionally include top_k and top_p parameters for non-claude-3.7 models * ci: add unit tests for getLLMConfig function with various model options * chore: remove all OPENROUTER_API_KEY legacy logic * refactor: optimize stream chunk handling * feat: reset model parameters button * refactor: remove unused examples field from convoSchema and presetSchema * chore: update librechat-data-provider version to 0.7.6993 * refactor: move excludedKeys set to data-provider for better reusability * feat: enhance saveMessageToDatabase to handle unset fields and fetched conversation state * feat: add 'iconURL' and 'greeting' to excludedKeys in data provider config * fix: add optional chaining to user ID retrieval in getConvo call * 🌍 i18n: Update translation.json with latest translations (#6009) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * 🚀 feat: Agent Cache Tokens & Anthropic Reasoning Support (#6098) * fix: handling of top_k and top_p parameters for Claude-3.7 models (allowed without reasoning) * feat: bump @librechat/agents for Anthropic Reasoning support * fix: update reasoning handling for OpenRouter integration * fix: enhance agent token spending logic to include cache creation and read details * fix: update logic for thinking status in ContentParts component * refactor: improve agent title handling * chore: bump @librechat/agents to version 2.1.7 for parallel tool calling for Google models * 🚀 feat: GPT-4.5, Anthropic Tool Header, and OpenAPI Ref Resolution (#6118) * 🔧 refactor: Update settings to use 'as const' for improved type safety and make gpt-4o-mini default model (cheapest) * 📖 docs: Update README to reflect support for GPT-4.5 in image analysis feature * 🔧 refactor: Update model handling to use default settings and improve encoding logic * 🔧 refactor: Enhance model version extraction logic for improved compatibility with future GPT and omni models * feat: GPT-4.5 tx/token update, vision support * fix: $ref resolution logic in OpenAPI handling * feat: add new 'anthropic-beta' header for Claude 3.7 to include token-efficient tools; ref: https://docs.anthropic.com/en/docs/build-with-claude/tool-use/token-efficient-tool-use * 🖼️ refactor: Enhance Env Extraction & Agent Image Handling (#6131) * refactor: use new image output format for agents using DALL-E tools * refactor: Enhance image fetching with proxy support and adjust logging placement in DALL-E 3 integration * refactor: Enhance StableDiffusionAPI to support agent-specific return values and display message for generated images * refactor: Add unit test execution for librechat-mcp in backend review workflow * refactor: Update environment variable extraction logic, export from serpate module to avoid circular refs, and remove deprecated tests * refactor: Add unit tests for environment variable extraction and enhance StdioOptionsSchema to process env variables * 🐼 feat: Add Flux Image Generation Tool (#6147) * 🔧 fix: Log warning for aborted operations in AgentClient * ci: Remove unused saveMessageToDatabase mock in FakeClient initialization * ci: test actual implementation of saveMessageToDatabase * refactor: Change log level from warning to error for aborted operations in AgentClient * refactor: Add className prop to Image component for customizable styling, use theme selectors * feat: FLUX Image Generation tool * 🌍 i18n: Update translation.json with latest translations (#6132) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * 🧠 feat: Bedrock Anthropic Reasoning & Update Endpoint Handling (#6163) * feat: Add thinking and thinkingBudget parameters for Bedrock Anthropic models * chore: Update @librechat/agents to version 2.1.8 * refactor: change region order in params * refactor: Add maxTokens parameter to conversation preset schema * refactor: Update agent client to use bedrockInputSchema and improve error handling for model parameters * refactor: streamline/optimize llmConfig initialization and saving for bedrock * fix: ensure config titleModel is used for all endpoints * refactor: enhance OpenAIClient and agent initialization to support endpoint checks for OpenRouter * chore: bump @google/generative-ai * 🌍 i18n: Update translation.json with latest translations (#6159) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * 🚀 feat: Enhance Model Handling, Logging & xAI Agent Support (#6182) * chore: update @librechat/agents to version 2.1.9 * feat: xAI standalone provider for agents * chore: bump librechat-data-provider version to 0.7.6997 * fix: reorder import statements and enhance user listing output * fix: Update Docker Compose commands to support v2 syntax with fallback * 🔧 fix: drop `reasoning_effort` for o1-preview/mini models * chore: requireLocalAuth logging * fix: edge case artifact message editing logic to handle `new` conversation IDs * fix: remove `temperature` from model options in OpenAIClient if o1-mini/preview * fix: update type annotation for fetchPromisesMap to use Promise<string[]> instead of string[] * feat: anthropic model fetching * fix: update model name to use EModelEndpoint.openAI in fetchModels and fetchOpenAIModels * fix: add error handling to modelController for loadModels * fix: add error handling and logging for model fetching in loadDefaultModels * ci: update getAnthropicModels tests to be asynchronous * feat: add user ID to model options in OpenAI and custom endpoint initialization --------- Co-authored-by: Andrei Berceanu <[email protected]> Co-authored-by: KiGamji <[email protected]> * 🪄 feat: Customize Sandpack `bundlerURL` for Artifacts (#6191) * 🕒 feat: Add Configurable MCP Server Timeouts (#6199) * 🚀 feat: Add Code API Proxy Support and Update MCP SDK (#6203) * chore: bump mcp sdk * feat: Add proxy support for file download and upload in Code Environment CRUD operations * chore: remove unused files * chore: change output format from CommonJS to ES module in server rollup config * ✨ v0.7.7 (#6206) * v0.7.7 * chore: Bump librechat-mcp version to 1.1.0 * action: update Unreleased changelog * Update CHANGELOG.md --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Ruben Talstra <[email protected]> * 📦 refactor: Move DB Models to `@librechat/data-schemas` (#6210) * 🚀 feat: Introduce data schemas and refactor models to use @librechat/data-schemas * 🚀 feat: Add installation step for Data Schemas Package in backend review workflow * chore: Add `data-schemas` package to update/rebuild packages scripts * chore: Update Dockerfile to include data-schemas package build process * fix: add missing @rollup/plugin-typescript package * chore: Add GitHub Actions workflow for publishing data-schemas package --------- Co-authored-by: Danny Avila <[email protected]> * 🌍 i18n: Add Thai Language Support and Update Translations (#6219) * 🌍 i18n: Add Thai Language Support and Update Translations * 📝 docs: Update Locize Logo in README.md * 📦 ci: `npm publish` access to public for `data-schemas` * 📦 ci: Update workflow to publish `@librechat/data-schemas` to NPM with manual trigger option * 📦 ci: Refactor workflow to combine build and publish steps with version check for `@librechat/data-schemas` * 📦 ci: Update npm authentication token for publishing in workflow * 🌍 i18n: Update translation.json with latest translations (#6220) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * 📦 chore: Patch `axios` to address CVE-2025-27152 (#6222) * 📦 chore: remove `langchain` (no longer used) * chore: patch `axios` to address CVE-2025-27152 * 🐛 fix: Avatar Type Definitions in Agent/Assistant Schemas (#6235) * fix: Simplify avatar type definition in agent and assistant schemas * fix: Update regex to correctly match OpenAI model identifiers * 🌍 i18n: Update translation.json with latest translations (#6240) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * 🔧 fix: MeiliSearch Field Error and Patch Incorrect Import by #6210 (#6245) * 📦 refactor: Update MeiliSearch integration and improve schema handling * Update indexSync.js * 📦 refactor: Update Conversation model import path in indexSync.js * 📦 refactor: Update import paths for Conversation and Message models in indexSync.js * 🔏 fix: Enhance Two-Factor Authentication (#6247) * 🌟 feat: Implement Two-Factor Authentication (2FA) functionality * fix: Two-Factor Authentication Logic and State Management * 🌟 feat: Add LICENSE file and update package version to 0.0.2 with MIT license * ⚠️ refactor: Use Error Content Part Instead Of Throwing Error for Agents (#6262) * 🐛 fix: Await saveMessage in abortMiddleware to ensure proper execution (#6248) * 🌍 i18n: Update translation.json with latest translations (#6241) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * 🔍 feat: Mistral OCR API / Upload Files as Text (#6274) * refactor: move `loadAuthValues` to `~/services/Tools/credentials` * feat: add createAxiosInstance function to configure axios with proxy support * WIP: First pass mistral ocr * refactor: replace getConvoFiles with getToolFiles for improved file retrieval logic * refactor: improve document formatting in encodeAndFormat function * refactor: remove unused resendFiles parameter from buildOptions function (this option comes from the agent config) * fix: update getFiles call to include files with `text` property as well * refactor: move file handling to `initializeAgentOptions` * refactor: enhance addImageURLs method to handle OCR text and improve message formatting * refactor: update message formatting to handle OCR text in various content types * refactor: remove unused resendFiles property from compactAgentsSchema * fix: add error handling for Mistral OCR document upload and logging * refactor: integrate OCR capability into file upload options and configuration * refactor: skip processing for text source files in delete request, as they are directly tied to database * feat: add metadata field to ExtendedFile type and update PanelColumns and PanelTable components for localization and metadata handling * fix: source icon styling * wip: first pass, frontend file context agent resources * refactor: add hover card with contextual information for File Context (OCR) in FileContext component * feat: enhance file processing by integrating file retrieval for OCR resources in agent initialization * feat: implement OCR config; fix: agent resource deletion for ocr files * feat: enhance agent initialization by adding OCR capability check in resource priming * ci: fix `~/config` module mock * ci: add OCR property expectation in AppService tests * refactor: simplify OCR config loading by removing environment variable extraction, to be done when OCR is actually performed * ci: add unit test to ensure environment variable references are not parsed in OCR config * refactor: disable base64 image inclusion in OCR request * refactor: enhance OCR configuration handling by validating environment variables and providing defaults * refactor: use file stream from disk for mistral ocr api * 🎨 a11y: Update Model Spec Description Text (#6294) * 🔧 fix: Axios Proxy Usage And Bump `mongoose` (#6298) * fix: bump mongoose to fix nested schema errors * fix: Enhance Axios instance creation with improved proxy handling and error logging * fix: Refactor Axios instance creation and remove proxy handling from file upload functions * fix: Update proxy configuration in Axios instance creation and add unit tests * 🤖 feat: Support OpenAI Web Search models (#6313) * fix: reorder vision model entries for cheaper models first * fix: add endpoint property to bedrock client initialization * fix: exclude unsupported parameters for OpenAI Web Search models * fix: enhance options to exclude unsupported parameters for Web Search models * 🔧 fix: comment out MCP servers to resolve service run issues (#6316) Co-authored-by: Coding Wizard <[email protected]> * 🔗 feat: Agent Chain (Mixture-of-Agents) (#6374) * wip: first pass, dropdown for selecting sequential agents * refactor: Improve agent selection logic and enhance performance in SequentialAgents component * wip: seq. agents working ideas * wip: sequential agents style change * refactor: move agent form options/submission outside of AgentConfig * refactor: prevent repeating code * refactor: simplify current agent display in SequentialAgents component * feat: persist form value handling in AgentSelect component for agent_ids * feat: first pass, sequential agnets agent update * feat: enhance message display with agent updates and empty text handling * chore: update Icon component to use EModelEndpoint for agent endpoints * feat: update content type checks in BaseClient to use constants for better readability * feat: adjust max context tokens calculation to use 90% of the model's max tokens * feat: first pass, agent run message pruning * chore: increase max listeners for abort controller to prevent memory leaks * feat: enhance runAgent function to include current index count map for improved token tracking * chore: update @librechat/agents dependency to version 2.2.5 * feat: update icons and style of SequentialAgents component for improved UI consistency * feat: add AdvancedButton and AdvancedPanel components for enhanced agent settings navigation, update styling for agent form * chore: adjust minimum height of AdvancedPanel component for better layout consistency * chore: update @librechat/agents dependency to version 2.2.6 * feat: enhance message formatting by incorporating tool set into agent message processing, in order to allow better mix/matching of agents (as tool calls for tools not found in set will be stringified) * refactor: reorder components in AgentConfig for improved readability and maintainability * refactor: enhance layout of AgentUpdate component for improved visual structure * feat: add DeepSeek provider to Bedrock settings and schemas * feat: enhance link styling in mobile.css for better visibility and accessibility * fix: update banner model import in update banner script; export Banner model * refactor: `duplicateAgentHandler` to include tool_resources only for OCR context files * feat: add 'qwen-vl' to visionModels for enhanced model support * fix: change image format from JPEG to PNG in DALLE3 response * feat: reorganize Advanced components and add localizations * refactor: simplify JSX structure in AgentChain component to defer container styling to parent * feat: add FormInput component for reusable input handling * feat: make agent recursion limit configurable from builder * feat: add support for agent capabilities chain in AdvancedPanel and update data-provider version * feat: add maxRecursionLimit configuration for agents and update related documentation * fix: update CONFIG_VERSION to 1.2.3 in data provider configuration * feat: replace recursion limit input with MaxAgentSteps component and enhance input handling * feat: enhance AgentChain component with hover card for additional information and update related labels * fix: pass request and response objects to `createActionTool` when using assistant actions to prevent auth error * feat: update AgentChain component layout to include agent count display * feat: increase default max listeners and implement capability check function for agent chain * fix: update link styles in mobile.css for better visibility in dark mode * chore: temp. remove agents package while bumping shared packages * chore: update @langchain/google-genai package to version 0.1.11 * chore: update @langchain/google-vertexai package to version 0.2.2 * chore: add @librechat/agents package at version 2.2.8 * feat: add deepseek.r1 model with token rate and context values for bedrock * 🔧 fix: Update Token Calculations/Mapping, MCP `env` Initialization (#6406) * fix: Enhance MCP initialization to process environment variables * fix: only build tokenCountMap with messages that are being used in the payload * fix: Adjust maxContextTokens calculation to account for maxOutputTokens * refactor: Make processMCPEnv optional in MCPManager initialization * chore: Bump version of librechat-data-provider to 0.7.73 * ⌛ feat: `initTimeout` for Slow Starting MCP Servers (#6383) * feat: make mcp server connect timeout configurable with initTimeout * style: add missing semicolon to connection.ts * 🚀 feat: `S3` Integration for File handling and Image uploads (#6142) * French Translation Update * French Translation Update * test * Add fileStrategy S3 Config * update s3 crud.js * 🔧 chore: downgrade dotenv to version 16.0.3 and add aws-sdk to package-lock.json * 🔧 chore: remove aws-sdk from package.json * 🚀 feat: Integrate AWS SDK for S3 with enhanced upload and retrieval functionalities * 🚀 feat: Implement S3 integration for file upload and retrieval functionalities * 🚀 feat: Enhance S3 initialization to support default credentials and improved error handling --------- Co-authored-by: Gael Martins <[email protected]> * 🐞 fix: Agent "Resend" Message Attachments + Source Icon Styling (#6408) * style: Update text file source icon background color for improved visibility in light mode * style: Update `vectordb` source icon background color for better visibility * fix: resend files behavior for tool resource message attachments (code interpreter and file search); Rename `getToolFiles` to `getConvoFiles` and simplify file retrieval logic; add `getToolFilesByIds` for fetching tool files by IDs * 🐛 fix: Prevent Crash on Duplicate Message ID (#6392) * fix: prevent crash on duplicate message ID Added error handling for MongoDB error code 11000 (duplicate key error) in saveMessage function. This prevents the application from crashing when trying to save messages with duplicate IDs, which can happen during aborted requests. Now logs a warning and continues execution safely. Closes: #5774 Closes: #5776 * fix: address ESLint issues in Message.js --------- Co-authored-by: odrec <
Summary
I updated the Transaction model's balance update logic to handle race conditions during concurrent token refill transactions. I introduced an optimistic concurrency control mechanism with retries and exponential backoff to guard against conflicts, and I added a new test case simulating 25 simultaneous auto refill transactions to verify that the final balance remains accurate.
Change Type:
Testing:
Checklist: