From 7aef0bf25ee6df987ed74a904c3e7ed7ed7c4118 Mon Sep 17 00:00:00 2001 From: Kyle Carberry Date: Mon, 2 Mar 2026 14:11:25 -0500 Subject: [PATCH] fix(chatd): increase title generation timeout from 10s to 30s (#22501) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Problem Production logs frequently show: ``` [debu] coderd.chats.chat-processor: failed to generate chat title error= generate title text: context deadline exceeded ``` ## Root Cause The title generation timeout in `maybeGenerateChatTitle` is 10 seconds. Many LLM providers routinely exceed this under load (cold starts, rate limits, large models). Since `chatretry` classifies `context deadline exceeded` as non-retryable, the first timeout kills the entire attempt with no retry. ## Fix Increase the timeout from 10s to 30s. Title generation is async and best-effort — it runs in a background goroutine and doesn't block the chat response — so a longer timeout has no user-facing impact. --- coderd/chatd/title.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coderd/chatd/title.go b/coderd/chatd/title.go index 688a112fd6..238acc3eec 100644 --- a/coderd/chatd/title.go +++ b/coderd/chatd/title.go @@ -35,7 +35,7 @@ func (p *Server) maybeGenerateChatTitle( return } - titleCtx, cancel := context.WithTimeout(ctx, 10*time.Second) + titleCtx, cancel := context.WithTimeout(ctx, 30*time.Second) defer cancel() title, err := generateTitle(titleCtx, model, input)