diff --git a/coderd/x/chatd/chatd.go b/coderd/x/chatd/chatd.go index 3978b4e462..9338dda90f 100644 --- a/coderd/x/chatd/chatd.go +++ b/coderd/x/chatd/chatd.go @@ -8630,6 +8630,10 @@ func (p *Server) updateLastTurnSummary( updatedChat := chat updatedChat.LastTurnSummary = lastTurnSummary p.publishChatPubsubEvent(updatedChat, codersdk.ChatWatchEventKindSummaryChange, nil) + + // AcquireChats uses SKIP LOCKED; re-wake so a wake racing this + // UPDATE's row lock does not strand a freshly-pending chat. + p.signalWake() } func (p *Server) webpushConfigured() bool { diff --git a/coderd/x/chatd/quickgen.go b/coderd/x/chatd/quickgen.go index e76545527e..13a7feba70 100644 --- a/coderd/x/chatd/quickgen.go +++ b/coderd/x/chatd/quickgen.go @@ -262,6 +262,10 @@ func (p *Server) maybeGenerateChatTitle( chat.Title = title generatedTitle.Store(title) p.publishChatPubsubEvent(chat, codersdk.ChatWatchEventKindTitleChange, nil) + + // AcquireChats uses SKIP LOCKED; re-wake so a wake racing this + // UPDATE's row lock does not strand a freshly-pending chat. + p.signalWake() return }