Alex
6826313b60
feat(quotas): limit resolution and the quota service
...
docsgpt/quotas resolves a user's effective token and cost limits from the
policy rows that apply to them: their own override, then the most generous
allowance among their teams, then the instance default, then any defaults a
registered provider supplies. Each budget resolves on its own, and a team
counts once however many memberships the user holds in it.
QuotaService compares those limits with the user's token_usage totals over
the current QUOTA_PERIOD window (calendar-aligned, UTC, computed at read
time). It fails open, and skips the usage query for unlimited users.
2026-09-21 12:11:11 +01:00
..
2026-09-21 12:11:11 +01:00
2026-09-21 10:55:33 +01:00
2026-09-21 11:38:22 +01:00
2026-09-17 13:34:59 +01:00
2026-09-14 14:12:21 +01:00
2026-09-12 19:35:22 +01:00
2026-08-21 13:04:57 +01:00
2026-09-20 10:54:55 +01:00
2026-09-07 10:20:43 +01:00
2026-09-07 10:20:43 +01:00
2026-09-21 12:11:11 +01:00
2026-09-17 11:14:34 +01:00
2026-09-21 12:11:11 +01:00
2026-09-20 10:45:03 +01:00
2026-09-07 10:20:43 +01:00
2026-09-15 17:54:24 +01:00
2026-09-12 17:44:18 +01:00
2026-09-07 10:20:43 +01:00
2026-09-07 10:20:43 +01:00
2026-09-21 12:11:11 +01:00
2026-09-15 17:54:24 +01:00
2026-09-15 17:54:24 +01:00
2026-09-19 14:07:42 +01:00
2026-09-14 17:27:13 +01:00
2026-03-12 14:46:26 +00:00
2026-09-14 12:52:15 +01:00
2026-09-19 14:07:41 +01:00
2026-09-14 12:52:15 +01:00
2026-04-18 13:13:57 +01:00
2026-09-07 10:20:43 +01:00
2026-09-07 10:20:43 +01:00
2026-09-15 17:54:24 +01:00
2026-09-07 10:20:43 +01:00
2026-09-14 08:33:46 +01:00
2026-09-14 10:19:59 +01:00
2026-09-14 12:52:15 +01:00
2026-09-07 10:20:43 +01:00
2026-09-07 10:20:43 +01:00
2026-09-07 10:20:43 +01:00
2026-09-19 14:53:18 +01:00
2026-09-17 11:32:50 +01:00
2026-09-07 10:20:43 +01:00
2026-09-07 10:20:43 +01:00
2026-09-07 10:20:43 +01:00
2026-09-07 10:20:43 +01:00
2026-09-07 10:20:43 +01:00
2026-09-20 10:45:03 +01:00
2026-09-07 10:20:43 +01:00
2026-09-07 10:20:43 +01:00
2026-09-14 10:19:59 +01:00
2026-09-14 21:46:09 +01:00
2026-01-22 13:11:24 +02:00
2026-09-07 10:20:43 +01:00
2026-09-07 10:20:43 +01:00
2026-09-07 10:20:43 +01:00
2026-09-07 10:20:43 +01:00
2026-09-07 10:20:43 +01:00
2026-09-07 10:20:43 +01:00
2026-09-07 10:20:43 +01:00
2023-10-15 17:00:54 +05:30
2026-09-12 17:28:58 +01:00
2026-09-07 12:02:07 +01:00
2026-09-21 11:38:22 +01:00
2026-09-07 10:20:43 +01:00
2026-09-07 10:20:43 +01:00
2026-09-07 10:20:43 +01:00
2026-09-17 11:04:01 +01:00
2026-09-07 10:20:43 +01:00
2026-09-07 10:20:43 +01:00
2026-09-07 10:20:43 +01:00
2026-09-14 12:52:15 +01:00
2026-09-07 10:20:43 +01:00
2026-09-07 10:20:43 +01:00
2026-09-07 10:20:43 +01:00
2026-09-07 10:20:43 +01:00
2026-09-07 10:20:43 +01:00
2026-09-09 11:09:09 +01:00
2026-09-14 17:27:13 +01:00
2026-09-21 12:11:11 +01:00
2026-09-15 17:54:24 +01:00
2026-09-07 10:20:43 +01:00
2026-09-07 10:20:43 +01:00
2026-09-07 10:20:43 +01:00
2026-09-07 10:20:43 +01:00