LibreChat/api/models
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
..
plugins 🔧 fix: MeiliSearch Field Error and Patch Incorrect Import by #6210 (#6245) 2025-03-08 14:37:33 -05:00
schema 📦 refactor: Move DB Models to @librechat/data-schemas (#6210) 2025-03-07 11:55:44 -05:00
Action.js 📦 refactor: Move DB Models to @librechat/data-schemas (#6210) 2025-03-07 11:55:44 -05:00
Agent.js 📦 refactor: Move DB Models to @librechat/data-schemas (#6210) 2025-03-07 11:55:44 -05:00
Agent.spec.js 🛠 refactor: Ensure File Deletions, File Naming, and Agent Resource Updates (#5928) 2025-02-17 19:37:03 -05:00
Assistant.js 📦 refactor: Move DB Models to @librechat/data-schemas (#6210) 2025-03-07 11:55:44 -05:00
Balance.js 🏗️ fix: Agents Token Spend Race Conditions, Add Auto-refill Tx, Add Relevant Tests (#6480) 2025-03-22 17:54:25 -04:00
balanceMethods.js 🏗️ fix: Agents Token Spend Race Conditions, Add Auto-refill Tx, Add Relevant Tests (#6480) 2025-03-22 17:54:25 -04:00
Banner.js 🔗 feat: Agent Chain (Mixture-of-Agents) (#6374) 2025-03-17 16:43:44 -04:00
Categories.js 📦 refactor: Move DB Models to @librechat/data-schemas (#6210) 2025-03-07 11:55:44 -05:00
Config.js refactor(api): Central Logging 📜 (#1348) 2023-12-14 07:49:27 -05:00
Conversation.js 🐞 fix: Agent "Resend" Message Attachments + Source Icon Styling (#6408) 2025-03-19 03:27:20 -04:00
ConversationTag.js 📦 refactor: Move DB Models to @librechat/data-schemas (#6210) 2025-03-07 11:55:44 -05:00
convoStructure.spec.js feat: Implement Conversation Duplication & UI Improvements (#5036) 2024-12-18 11:10:34 -05:00
File.js 🐞 fix: Agent "Resend" Message Attachments + Source Icon Styling (#6408) 2025-03-19 03:27:20 -04:00
index.js 🔒 fix: resolve session persistence post password reset (#5077) 2024-12-23 05:12:07 -05:00
inviteUser.js 🔐 fix: token not using webcrypto (#4005) 2024-09-11 22:25:14 -04:00
Key.js 📦 refactor: Move DB Models to @librechat/data-schemas (#6210) 2025-03-07 11:55:44 -05:00
Message.js 🐛 fix: Prevent Crash on Duplicate Message ID (#6392) 2025-03-19 03:27:58 -04:00
Message.spec.js 🎥 feat: YouTube Tool (#5582) 2025-01-31 19:11:04 -05:00
Preset.js 🛡️ fix: Minor Vulnerabilities (#4543) 2024-10-24 15:50:48 -04:00
Project.js 📦 refactor: Move DB Models to @librechat/data-schemas (#6210) 2025-03-07 11:55:44 -05:00
Prompt.js 📦 refactor: Move DB Models to @librechat/data-schemas (#6210) 2025-03-07 11:55:44 -05:00
Role.js 📦 refactor: Move DB Models to @librechat/data-schemas (#6210) 2025-03-07 11:55:44 -05:00
Role.spec.js 📦 refactor: Move DB Models to @librechat/data-schemas (#6210) 2025-03-07 11:55:44 -05:00
Session.js 📦 refactor: Move DB Models to @librechat/data-schemas (#6210) 2025-03-07 11:55:44 -05:00
Share.js 📦 refactor: Move DB Models to @librechat/data-schemas (#6210) 2025-03-07 11:55:44 -05:00
spendTokens.js 🏗️ fix: Agents Token Spend Race Conditions, Add Auto-refill Tx, Add Relevant Tests (#6480) 2025-03-22 17:54:25 -04:00
spendTokens.spec.js 🏗️ fix: Agents Token Spend Race Conditions, Add Auto-refill Tx, Add Relevant Tests (#6480) 2025-03-22 17:54:25 -04:00
Token.js 📦 refactor: Move DB Models to @librechat/data-schemas (#6210) 2025-03-07 11:55:44 -05:00
ToolCall.js 📦 refactor: Move DB Models to @librechat/data-schemas (#6210) 2025-03-07 11:55:44 -05:00
Transaction.js 🏗️ fix: Agents Token Spend Race Conditions, Add Auto-refill Tx, Add Relevant Tests (#6480) 2025-03-22 17:54:25 -04:00
Transaction.spec.js 💵 feat: Add Automatic Balance Refill (#6452) 2025-03-21 17:48:11 -04:00
tx.js 🔗 feat: Agent Chain (Mixture-of-Agents) (#6374) 2025-03-17 16:43:44 -04:00
tx.spec.js 🔗 feat: Agent Chain (Mixture-of-Agents) (#6374) 2025-03-17 16:43:44 -04:00
User.js 📦 refactor: Move DB Models to @librechat/data-schemas (#6210) 2025-03-07 11:55:44 -05:00
userMethods.js 💵 feat: Add Automatic Balance Refill (#6452) 2025-03-21 17:48:11 -04:00