Skip to content

fix(coderd/x/chatd): truncate overlong generated chat titles instead of rejecting them - #28589

Merged
ibetitsmike merged 1 commit into
mainfrom
mike/chatd-title-truncate-overlong
Aug 25, 2026
Merged

fix(coderd/x/chatd): truncate overlong generated chat titles instead of rejecting them#28589
ibetitsmike merged 1 commit into
mainfrom
mike/chatd-title-truncate-overlong

Conversation

@ibetitsmike

Copy link
Copy Markdown
Collaborator

Chat title generation asks the model for a title in 2-8 words and then hard-rejects any response longer than 8 words (validateGeneratedTitle). Quickgen pins temperature for repeatable output, so a model that overshoots the budget for a given conversation overshoots on every retry: the rename dialog's Generate button returns a deterministic 500 (generate manual title: generated title exceeded 8 words) no matter how often it is clicked, and the automatic first-message path silently leaves the chat on its fallback title. On dev.coder.com this rejection fires 1-3 times a day; one chat took 13 consecutive manual failures on 2026-08-25 (14:22-14:27 UTC).

Truncate the normalized title to the 8-word budget in normalizeTitleOutput instead of rejecting it, and keep the empty-title validation. Both the automatic and manual title paths share this normalization, so both are fixed.

Xum (AI agent) authored this change and PR on Mike's behalf.

…of rejecting them

Generated titles longer than the prompt's 8-word budget were hard-rejected. Quickgen pins temperature, so a model that overshoots for a given conversation overshoots on every retry: manual title proposal returns a deterministic 500 (generated title exceeded 8 words) and automatic titles stay stuck on the fallback truncation. Truncate the normalized title to the word budget instead and keep the empty-title validation.
@ibetitsmike
ibetitsmike enabled auto-merge (squash) August 25, 2026 17:46
@ibetitsmike
ibetitsmike merged commit 60b0313 into main Aug 25, 2026
49 of 51 checks passed
@ibetitsmike
ibetitsmike deleted the mike/chatd-title-truncate-overlong branch August 25, 2026 17:56
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 25, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants