LibreChat/api
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
..
app/clients 🗄️ fix: Skip Attachments Deleted by Storage Retention Instead of Failing the Turn (#17910) 2026-11-08 23:38:47 +01:00
cache 🪪 feat: Name the Build and Config in Telemetry, Configure Stack Depth, Keep Scoped Frames (#17515) 2026-10-31 11:44:23 -04:00
config 🪦 refactor: Remove Dead Legacy API Modules and Root Tooling (#17114) 2026-10-15 12:25:24 +02:00
db 🏨 fix: Restore Strict Tenant Startup and Sign-In (#17441) 2026-10-26 01:08:30 +01:00
models 🥢 fix: Fit MCP App Snapshots Within Message Documents (#16299) 2026-10-01 03:46:17 +00:00
server 📏 fix: Measure Usage Percent Against the Allowance Each Period Granted (#17850) 2026-11-09 08:27:13 -05:00
strategies 🛂 fix: Only Hand Out OpenID Access Tokens the Bearer Verifier Accepts (#17904) 2026-11-08 23:40:21 +01:00
test 🧹 chore: Clear the Whole-Repo Lint Errors on Dev (#17702) 2026-11-01 01:23:47 +01:00
utils 💠 feat: Add Gemini 4 Argon Support (#17200) 2026-10-17 21:44:44 +02:00
jest.config.js 🦿 chore: Bump Agents SDK to 4.2.1 (#17664) 2026-10-31 15:17:05 -04:00
jsconfig.json
package.json 🪰 chore: Bump HTTP Dependencies and Scope Security Overrides (#17688) 2026-11-05 05:35:17 -05:00
recover-skill-upload.js 🔌 feat: Integrate Durable Skill Lifecycle Across Writers and Routes (#17043) 2026-10-16 09:05:05 -07:00
typedefs.js 🪦 refactor: Remove Dead Legacy API Modules and Root Tooling (#17114) 2026-10-15 12:25:24 +02:00