Commits
Click on a commit to change the comparison rangeFix active_slots display for rate limits with slot decay
Issue: The active_slots counter for global concurrency limits with
slot_decay_per_second configured was not updating in the UI/API,
appearing stuck at the maximum value even though rate limiting was
functioning correctly.
Root Cause: The read_concurrency_limit() and read_all_concurrency_limits()
functions were returning the raw active_slots database column instead of
computing the value with decay applied. While slot acquisition correctly
used active_slots_after_decay() to check availability, the API responses
did not reflect this computation.
Solution: Modified both read functions to:
1. Select the computed active_slots_after_decay() and denied_slots_after_decay()
values alongside the model
2. Override the model's active_slots and denied_slots attributes with the
computed values before returning
This ensures the API/UI displays accurate real-time slot availability that
accounts for time-based decay, matching the behavior used during slot
acquisition.
Fixes #20187
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Add populate_existing to force fresh fetch from database
Fixes session identity map issues where cached ORM objects
weren't being refreshed with computed decay values