RBoy
(RBoy)
January 4, 2026, 7:23pm
1
Happy new year!
I found a secondary bug after the original bug was fixed here:Minor UI bug in LLM Usage page - #2 by zogstrip
When the page loads the default time duration is last month.
I click on the model dropdown and I see this:
It’s showing me all the models that were used last month.
Now I select one of the models:
Now I click on Last 24 hours, it’s still showing me the same list (and usage):
This is wrong, it appears to caching the old list (and usage numbers).
If I refresh the page and click directly on last 24 hours without selecting any model first, now the drop down list show me the correct list (and corresponding usage).
1 Like
Nice catch @RBoy - I missed handling/clearing the cache when changing the period as well
main ← fix/ai-usage-dropdown-cache
merged 07:12AM - 07 Jan 26 UTC
Follow-up to a1cc09d22d.
The model and feature dropdown lists in the AI Usage… admin page weren't updating when users changed the time period. For example, switching from "Last month" to "Last 24 hours" would still show models that had no usage in the last 24 hours.
The root cause was a race condition in the caching mechanism. The cache was being cleared inside the async `fetchData` method, but tracked property changes in methods like `setPeriodDates` would trigger Glimmer re-renders before the cache was cleared. This caused the stale cached values to be used during re-render.
Additionally, the cache could be populated with empty arrays during initial render before the AJAX response arrived, preventing proper population once data was available.
The fix moves cache invalidation to happen synchronously before any tracked property changes, and only populates the cache when actual data is present. This ensures the dropdown options always reflect the currently selected time period.
Ref - https://meta.discourse.org/t/bug-in-llm-usage-ui/392652
1 Like