LibreChat/api/server/controllers
Danny Avila 57ab67cbac
📏 fix: Measure Usage Percent Against the Allowance Each Period Granted (#17850)
* 📏 fix: Measure Usage Percent Against the Allowance Each Period Granted

Store the credits granted at the start of each balance period on the record and measure the usage percent against it, so changing refillAmount or startBalance no longer moves a user's percent until their next grant. Legacy records fall back to the configured amount.

* 🕰️ fix: Ignore a Stored Allotment a Later Refill Has Replaced

Stamp each stored allotment with the time of its grant and measure against it only while no refill is more recent, so a refill by a replica that predates the field falls back to the configured amount instead of reporting usage against the prior period's allowance.

* 🔒 fix: Write the Allotment Grant Atomically and Return Its Period Start

Insert lastRefill with the credit, allotment and grant time when a balance record is created, so a racing creator never moves another's period start past its grant. Return lastRefill even without auto-refill so the client can place a stored allotment in its period, and fall back when it cannot.
2026-11-09 08:27:13 -05:00
..
__tests__ 🔐 fix: Retire Credentials by Their Committing Write and on Opt-In 2FA (#17504) 2026-11-05 22:53:11 +01:00
agents 🔐 fix: Authorize Restored MCP Tools Before Agent Revert Writes Them (#17843) 2026-11-09 07:20:31 -05:00
assistants ✒️ fix: Bind Assistant Avatar Updates to Authorized Owners (#17391) 2026-10-24 10:16:16 +02:00
auth 🔐 fix: Retire Credentials by Their Committing Write and on Opt-In 2FA (#17504) 2026-11-05 22:53:11 +01:00
AuthController.js 🛂 fix: Only Hand Out OpenID Access Tokens the Bearer Verifier Accepts (#17904) 2026-11-08 23:40:21 +01:00
AuthController.spec.js 🛂 fix: Only Hand Out OpenID Access Tokens the Bearer Verifier Accepts (#17904) 2026-11-08 23:40:21 +01:00
avatar.contentFilter.spec.js 🛍️ fix: Discover Managed Agents in Marketplace Search (#16324) 2026-09-24 22:48:56 -04:00
Balance.js 📏 fix: Measure Usage Percent Against the Allowance Each Period Granted (#17850) 2026-11-09 08:27:13 -05:00
Balance.spec.js 📏 fix: Measure Usage Percent Against the Allowance Each Period Granted (#17850) 2026-11-09 08:27:13 -05:00
EndpointController.js
FavoritesController.js
FavoritesController.spec.js
mcp.js 🔐 fix: Fence ACL Viewers and Surface Revocation Failures When Removing Shared MCP Servers (#17506) 2026-10-28 00:37:07 +01:00
mcpApps.js 🐛 fix: Restore MCP App Rendering and Actions (#16382) 2026-10-16 13:27:29 -07:00
mcpApps.test.js 🐛 fix: Restore MCP App Rendering and Actions (#16382) 2026-10-16 13:27:29 -07:00
ModelController.js
ModelController.spec.js
PermissionsController.js 🛂 feat: Audit Resource Sharing Changes and Fail Closed on Reversible Audit Writes (#17053) 2026-10-15 00:30:16 +02:00
PluginController.js 🔭 feat: Admin Config Read APIs (Resolved and Effective Config, Scope Catalog, Env Status) (#17383) 2026-10-24 09:23:22 +02:00
PluginController.spec.js 🪦 refactor: Remove Dead Legacy API Modules and Root Tooling (#17114) 2026-10-15 12:25:24 +02:00
ReasoningCapabilitiesController.js 🎚️ feat: Filter OpenRouter Reasoning Efforts by the Selected Model (#16808) 2026-10-08 18:04:13 +02:00
SkillStatesController.js 🔌 feat: Integrate Durable Skill Lifecycle Across Writers and Routes (#17043) 2026-10-16 09:05:05 -07:00
TokenConfigController.js
tools.js 🪦 chore: Retire the DALL-E 3 Tool (#17205) 2026-10-17 18:24:22 +02:00
TwoFactorController.js 🔐 fix: Retire Credentials by Their Committing Write and on Opt-In 2FA (#17504) 2026-11-05 22:53:11 +01:00
UserController.js 🔐 fix: Fence ACL Viewers and Surface Revocation Failures When Removing Shared MCP Servers (#17506) 2026-10-28 00:37:07 +01:00
UserController.spec.js 🗑️ fix: Route Delete-User CLI Through the Shared Account Erasure Cascade (#17033) 2026-10-14 23:53:16 +02:00