You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(chat): cache eviction on thumbs-down / faithfulness flag + hit-rate card
A cached answer otherwise lives for its full 7-day TTL even if it's wrong — a
thumbs-down or a hallucination flag couldn't clear it. Now each answer's ChatLog
row records the ChatCache id it's stored under (computeCacheId), so:
- recordFeedback: a thumbs-down (-1) evicts that entry.
- scoreFaithfulness: a flagged (likely-hallucinated) answer evicts it. The
generate path now awaits storeCache BEFORE firing the async monitor so the
entry exists when the judge (a multi-second call) decides to evict it.
- CacheHit carries its row id, so a thumbs-down on a *cached* answer evicts too.
Also surfaces a "Cache hit rate" card (cacheHits / chats over the window) on the
admin Chat dashboard.
Verified live: fresh answer cached → thumbs-down → ChatCache row deleted
(1 → 0), and the next identical ask regenerates (cached flag absent); cacheId
recorded on both generated and cache-hit ChatLog rows; admin card renders 6.6%.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Eijma5uKcPZi9tqV2aJBeh
0 commit comments