LibreChat/api
Danny Avila 842b68fc32
🏗️ fix: Agents Token Spend Race Conditions, Add Auto-refill Tx, Add Relevant Tests (#6480)
* 🏗️ refactor: Improve spendTokens logic to handle zero completion tokens and enhance test coverage

* 🏗️ test: Add tests to ensure balance does not go below zero when spending tokens

* 🏗️ fix: Ensure proper continuation in AgentClient when handling errors

* fix: spend token race conditions

* 🏗️ test: Add test for handling multiple concurrent transactions with high balance

* fix: Handle Omni models prompt prefix handling for user messages with array content in OpenAIClient

* refactor: Update checkBalance import paths to use new balanceMethods module

* refactor: Update checkBalance imports and implement updateBalance function for atomic balance updates

* fix: import from replace method

* feat: Add createAutoRefillTransaction method to handle non-balance updating transactions

* refactor: Move auto-refill logic to balanceMethods and enhance checkBalance functionality

* feat: Implement logging for auto-refill transactions in balance checks

* refactor: Remove logRefill calls from multiple client and handler files

* refactor: Move balance checking and auto-refill logic to balanceMethods for improved structure

* refactor: Simplify balance check calls by removing unnecessary balanceRecord assignments

* fix: Prevent negative rawAmount in spendTokens when promptTokens is zero

* fix: Update balanceMethods to use Balance model for findOneAndUpdate

* chore: import order

* refactor: remove unused txMethods file to streamline codebase

* feat: enhance updateBalance and createAutoRefillTransaction methods to support additional parameters for improved balance management
2025-03-22 17:54:25 -04:00
..
app 🏗️ fix: Agents Token Spend Race Conditions, Add Auto-refill Tx, Add Relevant Tests (#6480) 2025-03-22 17:54:25 -04:00
cache 🛠 feat: Enhance Redis Integration, Rate Limiters & Log Headers (#6462) 2025-03-21 14:14:45 -04:00
config 🔧 fix: Axios Proxy Usage And Bump mongoose (#6298) 2025-03-11 14:44:54 -04:00
lib 🔧 fix: MeiliSearch Field Error and Patch Incorrect Import by #6210 (#6245) 2025-03-08 14:37:33 -05:00
models 🏗️ fix: Agents Token Spend Race Conditions, Add Auto-refill Tx, Add Relevant Tests (#6480) 2025-03-22 17:54:25 -04:00
server 🏗️ fix: Agents Token Spend Race Conditions, Add Auto-refill Tx, Add Relevant Tests (#6480) 2025-03-22 17:54:25 -04:00
strategies 🚀 feat: Add support for LDAP STARTTLS in LDAP Auth (#6438) 2025-03-21 07:55:09 -04:00
test 🔍 feat: Mistral OCR API / Upload Files as Text (#6274) 2025-03-10 17:23:46 -04:00
utils 🔗 feat: Agent Chain (Mixture-of-Agents) (#6374) 2025-03-17 16:43:44 -04:00
jest.config.js fix: Enhance Test Coverage and Fix Compatibility Issues 👷‍♂️ (#1363) 2023-12-15 13:27:13 -05:00
jsconfig.json feat(api): initial Redis support; fix(SearchBar): proper debounce (#1039) 2023-10-11 17:05:47 -04:00
package.json 🏃‍♂️ refactor: More Agent Context Improvements during Run (#6477) 2025-03-22 12:38:44 -04:00
typedefs.js 🔍 feat: Mistral OCR API / Upload Files as Text (#6274) 2025-03-10 17:23:46 -04:00