Skip to content

Commit 9ea58ee

Browse files
committed
Remove model selection functionality and definitions for Claude and GitHub Copilot
- remove changing model in github copilot - remove changing model in claude
1 parent 48f76fb commit 9ea58ee

4 files changed

Lines changed: 2 additions & 137 deletions

File tree

‎apps/browser/src/content-scripts/send-prompt-content-script/chatbots/claude.ts‎

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -24,58 +24,6 @@ export const claude: Chatbot = {
2424
})
2525
await new Promise((resolve) => setTimeout(resolve, 1000))
2626
},
27-
set_model: async (chat) => {
28-
const model = chat.model
29-
if (!model) return
30-
const model_selector_button = document.querySelector(
31-
'button[data-testid="model-selector-dropdown"]'
32-
) as HTMLButtonElement
33-
if (!model_selector_button) {
34-
report_initialization_error({
35-
function_name: 'set_model',
36-
log_message: 'Model selector button not found'
37-
})
38-
return
39-
}
40-
41-
const model_name_to_find = CHATBOTS['Claude'].models?.[model]?.label
42-
if (!model_name_to_find) {
43-
report_initialization_error({
44-
function_name: 'set_model',
45-
log_message: `Model "${model}" not found`
46-
})
47-
return
48-
}
49-
50-
if (model_selector_button.textContent?.includes(model_name_to_find)) {
51-
return
52-
}
53-
54-
model_selector_button.dispatchEvent(
55-
new PointerEvent('pointerdown', { bubbles: true })
56-
)
57-
await new Promise((r) => requestAnimationFrame(r))
58-
59-
const menu_items = document.querySelectorAll(
60-
'div[data-radix-popper-content-wrapper] div[role="menuitem"]'
61-
)
62-
63-
if (menu_items.length == 0) {
64-
report_initialization_error({
65-
function_name: 'set_model',
66-
log_message: 'Model selector menu items not found'
67-
})
68-
return
69-
}
70-
71-
for (const item of Array.from(menu_items)) {
72-
if (item.textContent?.includes(model_name_to_find)) {
73-
;(item as HTMLElement).click()
74-
break
75-
}
76-
}
77-
await new Promise((r) => requestAnimationFrame(r))
78-
},
7927
set_options: async (chat) => {
8028
const options = chat.options
8129
if (!options) return

‎apps/browser/src/content-scripts/send-prompt-content-script/chatbots/github-copilot.ts‎

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { Chatbot } from '../types/chatbot'
2-
import { CHATBOTS } from '@shared/constants/chatbots'
32
import {
43
add_apply_response_button,
54
observe_for_responses
@@ -19,68 +18,6 @@ export const github_copilot: Chatbot = {
1918
check_for_element()
2019
})
2120
},
22-
set_model: async (chat) => {
23-
const model = chat.model
24-
if (!model) return
25-
26-
const model_selector_button = document.querySelector(
27-
'form button[aria-haspopup="true"]'
28-
) as HTMLButtonElement
29-
if (!model_selector_button) {
30-
report_initialization_error({
31-
function_name: 'set_model',
32-
log_message: 'Model selector button not found'
33-
})
34-
return
35-
}
36-
37-
const model_label_to_find =
38-
CHATBOTS['GitHub Copilot'].models?.[model]?.label
39-
if (!model_label_to_find) return
40-
41-
if (model_selector_button.textContent?.includes(model_label_to_find)) {
42-
return
43-
}
44-
45-
model_selector_button.click()
46-
await new Promise((resolve) => setTimeout(resolve, 150))
47-
48-
const options_container = document.querySelector(
49-
'div[data-component="AnchoredOverlay"][data-width-medium]'
50-
)
51-
if (!options_container) {
52-
report_initialization_error({
53-
function_name: 'set_model',
54-
log_message: 'Model options container not found'
55-
})
56-
model_selector_button.click()
57-
return
58-
}
59-
60-
const options = options_container.querySelectorAll(
61-
'li[role="menuitemradio"]'
62-
)
63-
64-
let found = false
65-
for (const option of Array.from(options)) {
66-
if (option.textContent?.includes(model_label_to_find)) {
67-
;(option as HTMLElement).click()
68-
found = true
69-
break
70-
}
71-
}
72-
73-
if (!found) {
74-
report_initialization_error({
75-
function_name: 'set_model',
76-
log_message: `Model option "${model_label_to_find}" not found`
77-
})
78-
// click again to close dropdown
79-
model_selector_button.click()
80-
}
81-
82-
await new Promise((r) => requestAnimationFrame(r))
83-
},
8421
enter_message: async (params) => {
8522
const input_element = document.querySelector(
8623
'textarea'

‎apps/browser/src/manifest.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"name": "Autofill for Code Web Chat",
55
"short_name": "CWC",
66
"description": "Got tired with copy and paste? Enable prompt autofill!",
7-
"version": "1.117.0",
7+
"version": "1.118.0",
88
"homepage_url": "https://github.com/robertpiosik/CodeWebChat",
99
"icons": {
1010
"16": "icons/icon-16.png",

‎packages/shared/src/constants/chatbots.ts‎

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,6 @@ export const CHATBOTS = {
7373
url_override_disabled_options: ['incognito-chat'],
7474
supported_options: {
7575
'incognito-chat': 'Incognito chat'
76-
},
77-
models: {
78-
'sonnet-4-5': { label: 'Sonnet 4.5' },
79-
'haiku-4-5': { label: 'Haiku 4.5' },
80-
'opus-4-6': { label: 'Opus 4.6' }
8176
}
8277
} as Chatbot,
8378
Copilot: {
@@ -108,22 +103,7 @@ export const CHATBOTS = {
108103
'GitHub Copilot': {
109104
url: 'https://github.com/copilot',
110105
supports_url_override: true,
111-
url_override_label: 'Space URL',
112-
models: {
113-
'gpt-5-mini': { label: 'GPT-5 mini' },
114-
'grok-code-fast-1': { label: 'Grok Code Fast 1' },
115-
'gemini-3-flash': { label: 'Gemini 3 Flash' },
116-
'claude-haiku-4.5': { label: 'Claude Haiku 4.5' },
117-
'gpt-4.1': { label: 'GPT-4.1' },
118-
'gpt-4o': { label: 'GPT-4o' },
119-
'gpt-5': { label: 'GPT-5' },
120-
'gpt-5.1': { label: 'GPT-5.1' },
121-
'gpt-5.2': { label: 'GPT-5.2' },
122-
'claude-sonnet-4': { label: 'Claude Sonnet 4' },
123-
'claude-sonnet-4.5': { label: 'Claude Sonnet 4.5' },
124-
'claude-opus-4.5': { label: 'Claude Opus 4.5' },
125-
'gemini-3-pro': { label: 'Gemini 3 Pro' }
126-
}
106+
url_override_label: 'Space URL'
127107
} as Chatbot,
128108
Grok: {
129109
url: 'https://grok.com/',

0 commit comments

Comments
 (0)