Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

💄 style: increase chat topic title length (#14659)

Arvin Xue0ead0c47aed
diff --git a/packages/prompts/src/chains/__tests__/__snapshots__/summaryTitle.test.ts.snap b/packages/prompts/src/chains/__tests__/__snapshots__/summaryTitle.test.ts.snap
index 7a4ae9eaea5..8648a40e378 100644
--- a/packages/prompts/src/chains/__tests__/__snapshots__/summaryTitle.test.ts.snap
+++ b/packages/prompts/src/chains/__tests__/__snapshots__/summaryTitle.test.ts.snap
@@ -8,8 +8,8 @@ exports[`chainSummaryTitle > should use the default model if the token count is
Rules:
- Output ONLY the title text, no explanations or additional context
-- Maximum 10 words
-- Maximum 50 characters
+- Maximum 15 words
+- Maximum 80 characters
- No punctuation marks
- Use the language specified by the locale code: en-US
- The title should accurately reflect the main topic of the conversation
diff --git a/packages/prompts/src/chains/summaryTitle.ts b/packages/prompts/src/chains/summaryTitle.ts
index d5fa974a328..ea612283424 100644
--- a/packages/prompts/src/chains/summaryTitle.ts
+++ b/packages/prompts/src/chains/summaryTitle.ts
@@ -10,8 +10,8 @@ export const chainSummaryTitle = (
Rules:
- Output ONLY the title text, no explanations or additional context
-- Maximum 10 words
-- Maximum 50 characters
+- Maximum 15 words
+- Maximum 80 characters
- No punctuation marks
- Use the language specified by the locale code: ${locale}
- The title should accurately reflect the main topic of the conversation
diff --git a/src/server/routers/lambda/thread.ts b/src/server/routers/lambda/thread.ts
index 848decb42ce..638cc28bbaf 100644
--- a/src/server/routers/lambda/thread.ts
+++ b/src/server/routers/lambda/thread.ts
@@ -73,7 +73,7 @@ export const threadRouter = router({
metadata: input.metadata,
parentThreadId: input.parentThreadId,
sourceMessageId: input.sourceMessageId,
- title: input.message.content.slice(0, 20),
+ title: input.message.content.slice(0, 80),
topicId: input.topicId,
type: input.type,
}),
diff --git a/src/store/chat/slices/aiChat/actions/conversationLifecycle.ts b/src/store/chat/slices/aiChat/actions/conversationLifecycle.ts
index 681539c3fbb..8f41c580e3c 100644
--- a/src/store/chat/slices/aiChat/actions/conversationLifecycle.ts
+++ b/src/store/chat/slices/aiChat/actions/conversationLifecycle.ts
@@ -504,7 +504,7 @@ export class ConversationLifecycleActionImpl {
newTopic: !operationContext.topicId
? {
metadata: workingDirectory ? { workingDirectory } : undefined,
- title: message.slice(0, 20) || t('defaultTitle', { ns: 'topic' }),
+ title: message.slice(0, 80) || t('defaultTitle', { ns: 'topic' }),
topicMessageIds: messages.map((m) => m.id),
}
: undefined,
@@ -738,7 +738,7 @@ export class ConversationLifecycleActionImpl {
newTopic: !topicId
? {
topicMessageIds: forceNewTopicFromExisting ? [] : messages.map((m) => m.id),
- title: message.slice(0, 20) || t('defaultTitle', { ns: 'topic' }),
+ title: message.slice(0, 80) || t('defaultTitle', { ns: 'topic' }),
}
: undefined,
agentId: operationContext.agentId,
@@ -885,7 +885,7 @@ export class ConversationLifecycleActionImpl {
}
const firstUserText = messages.find((m) => m.role === 'user')?.content?.trim() ?? '';
- const title = firstUserText.slice(0, 30) || 'New Topic';
+ const title = firstUserText.slice(0, 80) || 'New Topic';
await this.#get().internal_updateTopic(topicId, { title });
// summaryTopicTitle would normally clear loading via onLoadingChange; do it manually.
this.#get().internal_updateTopicLoading(topicId, false);