From 1a8cb0604f12148313c78616082c430d4a423503 Mon Sep 17 00:00:00 2001 From: Michael Chihlas Date: Sat, 25 Apr 2026 23:44:11 -0400 Subject: [PATCH] docs(ai): track currentChatRef silent-swallow follow-up in TODO The guard pattern that masked the prefill-ref bug fixed in PR #153 is applied across handleSend, handleTaskSubmit, selectChat, refreshFacts, refreshActiveFix, and refreshPreview. Worth either logging the mismatch path or distinguishing expected-stale from unexpected-stale so the next instance of this class of bug surfaces instead of hiding. Co-Authored-By: Claude Opus 4.7 --- .ai/TODO.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ai/TODO.md b/.ai/TODO.md index 38730ced..c9bcff75 100644 --- a/.ai/TODO.md +++ b/.ai/TODO.md @@ -9,4 +9,4 @@ ## Backlog -- [ ] No queued backlog yet. +- [ ] **AssistantChatPage `currentChatRef` guard is a silent return** — `handleSend`, `handleTaskSubmit`, `selectChat`, `refreshFacts`, `refreshActiveFix`, and `refreshPreview` all bail with `if (currentChatRef.current !== sentForChatId) return` when stale. This is by design for chat switching, but it also silently masked the prefill-ref bug fixed in PR #153 — the user just saw "no AI response" with no log, no toast, no Sentry event. Either (a) log a `console.warn`/Sentry breadcrumb on the mismatch path so future drift is visible, or (b) split "expected stale" (chat switch) from "unexpected stale" (ref never updated) so only the latter alerts. Pair with an audit of every `currentChatRef.current = ...` assignment vs every `setActiveChatId(...)` call to make sure they're paired everywhere.