Skip to content

Commit 3d0a547

Browse files
committed
Bug 1926933 - Add Copilot to list of chatbot providers r=ngrato
Add entry alphabetically to providers list. Differential Revision: https://phabricator.services.mozilla.com/D226819
1 parent 7650f71 commit 3d0a547

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

browser/components/genai/GenAI.sys.mjs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ XPCOMUtils.defineLazyPreferenceGetter(
7575
lazy,
7676
"chatProviders",
7777
"browser.ml.chat.providers",
78-
"claude,chatgpt,gemini,lechat",
78+
"claude,chatgpt,copilot,gemini,lechat",
7979
reorderChatProviders
8080
);
8181
XPCOMUtils.defineLazyPreferenceGetter(
@@ -162,7 +162,7 @@ export const GenAI = {
162162
},
163163
],
164164
[
165-
"https://copilot.microsoft.com",
165+
"https://copilot.microsoft.com/?form=MOZCMC",
166166
{
167167
choiceIds: [
168168
"genai-onboarding-copilot-generate",
@@ -1101,9 +1101,6 @@ export const GenAI = {
11011101
source: context.entry,
11021102
});
11031103

1104-
await this.prepareChatPromptPrefix();
1105-
const prompt = this.buildChatPrompt(promptObj, context);
1106-
11071104
// If no provider is configured, open sidebar and wait once for onboarding
11081105
const { SidebarController } = context.window;
11091106

@@ -1115,6 +1112,10 @@ export const GenAI = {
11151112
}
11161113
}
11171114

1115+
// Build prompt after provider is confirmed to use correct length limits
1116+
await this.prepareChatPromptPrefix();
1117+
const prompt = this.buildChatPrompt(promptObj, context);
1118+
11181119
// Pass the prompt via GET url ?q= param or request header
11191120
const { header, queryParam = "q" } =
11201121
this.chatProviders.get(lazy.chatProvider) ?? {};

browser/components/genai/tests/browser/browser_chat_sidebar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ add_task(async function test_sidebar_providers() {
7676
await SidebarController.show("viewGenaiChatSidebar");
7777

7878
const origCount = countVisible();
79-
Assert.equal(origCount, 4, "Rendered expected number of provider options");
79+
Assert.equal(origCount, 5, "Rendered expected number of provider options");
8080

8181
SidebarController.hide();
8282
await SpecialPowers.pushPrefEnv({

0 commit comments

Comments
 (0)