# LLM 使用界面中的错误

**URL:** https://meta.discourse.org/t/bug-in-llm-usage-ui/392652
**Category:** UX
**Tags:** ai
**Created:** [2026年一月4日 19:23 UTC](https://meta.discourse.org/t/bug-in-llm-usage-ui/392652 "2026-01-04T19:23:47Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [2026年一月6日 11:05 UTC](https://meta.discourse.org/t/bug-in-llm-usage-ui/392652/3 "2026-01-06T11:05:53Z")

</div>

干得好，@RBoy - 我也忘记在更改周期时处理/清除缓存了 🤦‍♂️

> <https://github.com/discourse/discourse/pull/36975>
>
> 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

---

_[View the full topic](https://meta.discourse.org/t/bug-in-llm-usage-ui/392652)._
