feat(ai): auto-title a conversation from its first user message#1850
Merged
xuyushun441-sys merged 1 commit intoJun 14, 2026
Merged
Conversation
The console sidebar lists conversations straight off the `ai_conversations` rows, so an untitled conversation renders a generic "New conversation" label — and once a user has a handful, the list is a wall of identical rows with no way to tell them apart or find one. Set `title` from the first USER message the moment it lands, in `addMessage`: collapse whitespace, cap at 60 chars. Deterministic, no extra model call. Only seeds when the conversation has no title yet and the turn is a user turn, so the optional LLM auto-titler still overwrites it with a nicer title when enabled, and an explicit title is never clobbered. Tests: untitled→titled, existing-title kept, assistant-first-turn ignored, whitespace-collapse + truncation. Suite green (23). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
xuyushun441-sys
deleted the
feat/ai-conversation-auto-title-first-message
branch
June 14, 2026 13:31
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
The console AI sidebar lists conversations straight off
ai_conversationsrows. An untitled conversation renders a generic "New conversation" label — so once a user has a few, the list is a wall of identical rows with no way to distinguish or find one. (Found dogfooding the AI app-builder: dozens of indistinguishable "新对话".)Conversations are created untitled and the list endpoint already returns
titlewhen present — but it was never set.Fix
In
ObjectQLConversationService.addMessage, settitlefrom the first user message the instant it lands (collapse whitespace, cap 60 chars). Deterministic, no extra model call.Verification
objectql-conversation-servicesuite green (23).title = "帮我建一个会议室预订系统"; the sidebar shows real titles instead of "新对话".🤖 Generated with Claude Code