fix(coderd/x/chatd): truncate overlong generated chat titles instead of rejecting them - #28589
Merged
Merged
Conversation
…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.
ThomasK33
approved these changes
Aug 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
normalizeTitleOutputinstead of rejecting it, and keep the empty-title validation. Both the automatic and manual title paths share this normalization, so both are fixed.