feat(threads): add title summary generation and settings #1256
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XL
github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) removed labelssize:XL
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
- @@ -2625,3 +2632,12 @@26252632 createdAt: messageCreatedAt,26262633 });26272634 turnStartSucceeded = true;2635+ if (isFirstMessage) {2636+ void maybeGenerateFirstThreadTitle({ api, threadId: threadIdForSend }).catch((error) => {2637+ toastManager.add({2638+ type: "error",2639+ title: "Failed to generate title summary",2640+ description: error instanceof Error ? error.message : "An error occurred.",2641+ });2642+ });2643+ }@@ -1155,3 +1155,4 @@11551155 commandId: providerCommandId(event, "thread-meta-update"),11561156 threadId: thread.id,11571157 title: event.payload.name,1158+ titleSummaryState: "generated",
github-actions[bot](GitHub profile, opens in a new tab) removed labelssize:L
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XL
- @@ -691,0 +702,21 @@702+ if (!thread || thread.deletedAt !== null) {703+ return yield* new RouteRequestError({704+ message: `Thread not found: ${input.threadId}`,705+ });706+ }707+708+ const project = snapshot.projects.find(709+ (entry) => entry.id === thread.projectId && entry.deletedAt === null,710+ );711+ if (!project) {712+ return yield* new RouteRequestError({713+ message: `Project not found for thread: ${input.threadId}`,714+ });715+ }716+717+ const userMessages = thread.messages.filter((message) => message.role === "user");718+ if (userMessages.length === 0) {719+ return yield* new RouteRequestError({720+ message: "Thread has no user messages to summarize.",721+ });722+ }@@ -465,4 +519,21 @@519+ const generated = yield* runCodexJson({520+ operation: "generateThreadTitle",521+ cwd: input.cwd,522+ prompt: promptSections.join("\n"),523+ outputSchemaJson: Schema.Struct({524+ title: Schema.String,525+ }),526+ imagePaths,527+ ...(input.model ? { model: input.model } : {}),528+ });529+530+ return {531+ title: sanitizeThreadTitle(generated.title),532+ } satisfies ThreadTitleGenerationResult;533+ });534+465535 return {466536 generateCommitMessage,467537 generatePrContent,468538 generateBranchName,539+ generateThreadTitle,
maria-rcks closed this
Sign in to join this conversation.


Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID:
1acf233a-238a-4432-8384-b44009274415You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share