commit c9fd191de6dfbd1f87e2e3b565cb6df777534a14
parent 4bbb0424eaaaa8cacc331025b59fb8a745cc7f3c
Author: Cosmin Sabou <csabou@mozilla.com>
Date: Tue, 6 Jan 2026 03:13:17 +0200
Revert "Bug 2001517 - Generate chat title when conversation is saved r=omarg,ai-frontend-reviewers" for causing failures on browser_all_files_referenced.
This reverts commit 2c67aad3e77591e039b5a90783f19892ba3efb32.
Diffstat:
1 file changed, 0 insertions(+), 30 deletions(-)
diff --git a/browser/components/aiwindow/ui/components/ai-window/ai-window.mjs b/browser/components/aiwindow/ui/components/ai-window/ai-window.mjs
@@ -8,8 +8,6 @@ import { MozLitElement } from "chrome://global/content/lit-utils.mjs";
const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
Chat: "moz-src:///browser/components/aiwindow/models/Chat.sys.mjs",
- generateChatTitle:
- "moz-src:///browser/components/aiwindow/models/TitleGeneration.sys.mjs",
AIWindow:
"moz-src:///browser/components/aiwindow/ui/modules/AIWindow.sys.mjs",
ChatConversation:
@@ -84,33 +82,6 @@ export class AIWindow extends MozLitElement {
}
/**
- * Generates and sets a title for the conversation if one doesn't exist.
- *
- * @private
- */
- async #addConversationTitle() {
- if (this.#conversation.title) {
- return;
- }
-
- const firstUserMessage = this.#conversation.messages.find(
- m => m.role === lazy.MESSAGE_ROLE.USER
- );
-
- const title = await lazy.generateChatTitle(
- firstUserMessage?.content?.body,
- {
- url: firstUserMessage?.pageUrl?.href || "",
- title: this.#conversation.pageMeta?.title || "",
- description: this.#conversation.pageMeta?.description || "",
- }
- );
-
- this.#conversation.title = title;
- this.#updateConversation();
- }
-
- /**
* Fetches an AI response based on the current user prompt.
* Validates the prompt, updates conversation state, streams the response,
* and dispatches updates to the browser actor.
@@ -138,7 +109,6 @@ export class AIWindow extends MozLitElement {
await this.#conversation.generatePrompt(this.userPrompt)
);
this.#updateConversation();
- this.#addConversationTitle();
this.userPrompt = "";