Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/_locales/de/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@
"Generating...": "Generieren...",
"moonshot token required, please login at https://kimi.com first, and then click the retry button": "Moonshot-Token erforderlich, bitte zuerst bei https://kimi.com anmelden und dann auf die Schaltfläche Wiederholen klicken",
"Hide context menu of this extension": "Kontextmenü dieser Erweiterung ausblenden",
"Custom Claude API Url": "Benutzerdefinierte Claude-API-URL",
"Custom Anthropic API Url": "Benutzerdefinierte Anthropic-API-URL",
"Anthropic API Key": "Anthropic-API-Schlüssel",
"Cancel": "Abbrechen",
"Name is required": "Name ist erforderlich",
"Prompt template should include {{selection}}": "Die Vorlage sollte {{selection}} enthalten",
Expand Down
3 changes: 2 additions & 1 deletion src/_locales/en/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@
"Generating...": "Generating...",
"moonshot token required, please login at https://kimi.com first, and then click the retry button": "moonshot token required, please login at https://kimi.com first, and then click the retry button",
"Hide context menu of this extension": "Hide context menu of this extension",
"Custom Claude API Url": "Custom Claude API Url",
"Custom Anthropic API Url": "Custom Anthropic API Url",
"Anthropic API Key": "Anthropic API Key",
Comment on lines +136 to +137
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# 1. Confirm no source file still references the old locale key
echo "=== Old key references in source ==="
rg --type=js --type=jsx -n "Custom Claude API Url" || echo "None found"

# 2. Confirm no locale file still has the old key
echo ""
echo "=== Locale files retaining old key ==="
rg -n "Custom Claude API Url" --glob="**/main.json" || echo "None found"

# 3. Confirm all locale files have the new keys
echo ""
echo "=== Locale files MISSING new keys ==="
fd -e json "main.json" --search-path src/_locales --exec sh -c \
  'grep -q "Custom Anthropic API Url" "$1" || echo "Missing Custom Anthropic API Url: $1"; \
   grep -q "Anthropic API Key" "$1" || echo "Missing Anthropic API Key: $1"' _ {}

# 4. Confirm no remaining references to generateAnswersWithChatgptApiCompat
echo ""
echo "=== Stale generateAnswersWithChatgptApiCompat references ==="
rg -n "generateAnswersWithChatgptApiCompat" || echo "None found"

Repository: ChatGPTBox-dev/chatGPTBox

Length of output: 324


Key rename in en/main.json violates the "Do not change keys" guideline.

Per coding guidelines, keys in src/_locales/en/main.json should not be changed; instead, new strings should be added and propagated to other locales. This PR changed "Custom Claude API Url" to "Custom Anthropic API Url", which is a key rename rather than adding a new key.

Verification confirms the migration is complete across all in-tree files:

  • No references to the old key remain in source files or any locale file
  • All new keys are present in all locale files
  • All consumers have been updated

While the implementation is comprehensive and correct, the guideline exists to prevent breaking changes in localization keys. Future PRs should add new keys alongside old ones to maintain backward compatibility.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/_locales/en/main.json` around lines 136 - 137, You renamed a localization
key in src/_locales/en/main.json which violates the "Do not change keys" rule;
revert the rename by restoring the original "Custom Claude API Url" key and its
value in en/main.json, add a new separate key "Custom Anthropic API Url" with
the desired value (do not remove the original), propagate the new key to all
other locale files (adding the new entry alongside existing ones), and update
any consumers that should use the new key to reference "Custom Anthropic API
Url" while leaving consumers still using "Custom Claude API Url" unchanged to
preserve backward compatibility.

"Cancel": "Cancel",
"Name is required": "Name is required",
"Prompt template should include {{selection}}": "Prompt template should include {{selection}}",
Expand Down
3 changes: 2 additions & 1 deletion src/_locales/es/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@
"Generating...": "Generando...",
"moonshot token required, please login at https://kimi.com first, and then click the retry button": "se requiere un token de moonshot, por favor inicie sesión en https://kimi.com primero, y luego haga clic en el botón Reintentar",
"Hide context menu of this extension": "Ocultar menú contextual de esta extensión",
"Custom Claude API Url": "URL personalizada de la API de Claude",
"Custom Anthropic API Url": "URL personalizada de la API de Anthropic",
"Anthropic API Key": "Clave API de Anthropic",
"Cancel": "Cancelar",
"Name is required": "Se requiere un nombre",
"Prompt template should include {{selection}}": "La plantilla de sugerencias debe incluir {{selection}}",
Expand Down
3 changes: 2 additions & 1 deletion src/_locales/fr/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@
"Generating...": "Génération...",
"moonshot token required, please login at https://kimi.com first, and then click the retry button": "jeton moonshot requis, veuillez vous connecter d'abord sur https://kimi.com, puis cliquez sur le bouton Réessayer",
"Hide context menu of this extension": "Masquer le menu contextuel de cette extension",
"Custom Claude API Url": "URL API Claude personnalisée",
"Custom Anthropic API Url": "URL API Anthropic personnalisée",
"Anthropic API Key": "Clé API Anthropic",
"Cancel": "Annuler",
"Name is required": "Le nom est requis",
"Prompt template should include {{selection}}": "Le modèle de suggestion doit inclure {{selection}}",
Expand Down
3 changes: 2 additions & 1 deletion src/_locales/in/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@
"Generating...": "Menghasilkan...",
"moonshot token required, please login at https://kimi.com first, and then click the retry button": "diperlukan token moonshot, silakan masuk di https://kimi.com terlebih dahulu, lalu klik tombol coba lagi",
"Hide context menu of this extension": "Sembunyikan menu konteks ekstensi ini",
"Custom Claude API Url": "URL API Claude Kustom",
"Custom Anthropic API Url": "URL API Anthropic Kustom",
"Anthropic API Key": "Kunci API Anthropic",
"Cancel": "Batal",
"Name is required": "Nama diperlukan",
"Prompt template should include {{selection}}": "Template prompt harus mencakup {{selection}}",
Expand Down
3 changes: 2 additions & 1 deletion src/_locales/it/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@
"Generating...": "Generazione...",
"moonshot token required, please login at https://kimi.com first, and then click the retry button": "richiesto token moonshot, effettua il login su https://kimi.com prima, quindi fai clic sul pulsante Riprova",
"Hide context menu of this extension": "Nascondi il menu contestuale di questa estensione",
"Custom Claude API Url": "URL API Claude personalizzato",
"Custom Anthropic API Url": "URL API Anthropic personalizzato",
"Anthropic API Key": "Chiave API Anthropic",
"Cancel": "Annulla",
"Name is required": "Il nome è obbligatorio",
"Prompt template should include {{selection}}": "Il modello di prompt dovrebbe includere {{selection}}",
Expand Down
3 changes: 2 additions & 1 deletion src/_locales/ja/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@
"Generating...": "生成中...",
"moonshot token required, please login at https://kimi.com first, and then click the retry button": "moonshotトークンが必要です。最初に https://kimi.com にログインしてから、再試行ボタンをクリックしてください",
"Hide context menu of this extension": "この拡張機能のコンテキストメニューを非表示",
"Custom Claude API Url": "カスタムClaude APIのURL",
"Custom Anthropic API Url": "カスタムAnthropic APIのURL",
"Anthropic API Key": "Anthropic API キー",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Minor spacing inconsistency in Japanese translation.

"Anthropic API キー" has a space before キー, while the existing "API Key": "APIキー" (line 85) has no space. Consider aligning to "Anthropic APIキー" for consistency.

🛠️ Suggested fix
-  "Anthropic API Key": "Anthropic API キー",
+  "Anthropic API Key": "Anthropic APIキー",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"Anthropic API Key": "Anthropic API キー",
"Anthropic API Key": "Anthropic APIキー",
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/_locales/ja/main.json` at line 137, The translation for the JSON key
"Anthropic API Key" has an inconsistent space—update its value from "Anthropic
API キー" to "Anthropic APIキー" to match the existing style used for "API Key":
"APIキー"; locate the "Anthropic API Key" entry and remove the space before "キー"
so translations remain consistent.

"Cancel": "キャンセル",
"Name is required": "名前は必須です",
"Prompt template should include {{selection}}": "プロンプトテンプレートには {{selection}} を含める必要があります",
Expand Down
3 changes: 2 additions & 1 deletion src/_locales/ko/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@
"Generating...": "생성 중...",
"moonshot token required, please login at https://kimi.com first, and then click the retry button": "moonshot 토큰이 필요합니다. https://kimi.com 에서 로그인한 다음 재시도 버튼을 클릭하세요.",
"Hide context menu of this extension": "이 확장 프로그램의 컨텍스트 메뉴 숨기기",
"Custom Claude API Url": "사용자 정의 Claude API URL",
"Custom Anthropic API Url": "사용자 정의 Anthropic API URL",
"Anthropic API Key": "Anthropic API 키",
"Cancel": "취소",
"Name is required": "이름은 필수입니다",
"Prompt template should include {{selection}}": "프롬프트 템플릿에는 {{selection}} 이 포함되어야 합니다",
Expand Down
3 changes: 2 additions & 1 deletion src/_locales/pt/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@
"Generating...": "Gerando...",
"moonshot token required, please login at https://kimi.com first, and then click the retry button": "token moonshot necessário, faça login em https://kimi.com primeiro e depois clique no botão de tentar novamente",
"Hide context menu of this extension": "Ocultar menu de contexto desta extensão",
"Custom Claude API Url": "URL da API Personalizada do Claude",
"Custom Anthropic API Url": "URL da API Personalizada do Anthropic",
"Anthropic API Key": "Chave API Anthropic",
"Cancel": "Cancelar",
"Name is required": "Nome é obrigatório",
"Prompt template should include {{selection}}": "O modelo de prompt deve incluir {{selection}}",
Expand Down
3 changes: 2 additions & 1 deletion src/_locales/ru/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@
"Generating...": "Генерация...",
"moonshot token required, please login at https://kimi.com first, and then click the retry button": "требуется токен moonshot, пожалуйста, сначала войдите на https://kimi.com, а затем нажмите кнопку повтора",
"Hide context menu of this extension": "Скрыть контекстное меню этого расширения",
"Custom Claude API Url": "Пользовательский URL API Claude",
"Custom Anthropic API Url": "Пользовательский URL API Anthropic",
"Anthropic API Key": "Ключ API Anthropic",
"Cancel": "Отмена",
"Name is required": "Имя обязательно",
"Prompt template should include {{selection}}": "Шаблон запроса должен включать {{selection}}",
Expand Down
3 changes: 2 additions & 1 deletion src/_locales/tr/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@
"Generating...": "Üretiliyor...",
"moonshot token required, please login at https://kimi.com first, and then click the retry button": "moonshot jetonu gereklidir, lütfen önce https://kimi.com adresinde oturum açın ve ardından yeniden dene düğmesine tıklayın",
"Hide context menu of this extension": "Bu uzantının bağlam menüsünü gizle",
"Custom Claude API Url": "Özel Claude API Url'si",
"Custom Anthropic API Url": "Özel Anthropic API Url'si",
"Anthropic API Key": "Anthropic API Anahtarı",
"Cancel": "İptal",
"Name is required": "İsim gereklidir",
"Prompt template should include {{selection}}": "Prompt şablonu {{selection}} içermelidir",
Expand Down
3 changes: 2 additions & 1 deletion src/_locales/zh-hans/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@
"Generating...": "正在生成...",
"moonshot token required, please login at https://kimi.com first, and then click the retry button": "请先登录Kimi: https://kimi.com, 然后点击重试按钮",
"Hide context menu of this extension": "隐藏此扩展的右键菜单",
"Custom Claude API Url": "自定义的Claude API地址",
"Custom Anthropic API Url": "自定义的Anthropic API地址",
"Anthropic API Key": "Anthropic API 密钥",
"Cancel": "取消",
"Name is required": "名称是必须的",
"Prompt template should include {{selection}}": "提示模板应该包含 {{selection}}",
Expand Down
3 changes: 2 additions & 1 deletion src/_locales/zh-hant/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@
"Generating...": "產生中...",
"moonshot token required, please login at https://kimi.com first, and then click the retry button": "需要 moonshot token,請先在 https://kimi.com 登入,然後點擊重試按鈕",
"Hide context menu of this extension": "隱藏此擴充功能的右鍵選單",
"Custom Claude API Url": "自訂 Claude API 網址",
"Custom Anthropic API Url": "自訂 Anthropic API 網址",
"Anthropic API Key": "Anthropic API 金鑰",
"Cancel": "取消",
"Name is required": "名稱是必填的",
"Prompt template should include {{selection}}": "提示範本應該包含 {{selection}}",
Expand Down
10 changes: 5 additions & 5 deletions src/background/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
} from '../services/apis/chatgpt-web'
import { generateAnswersWithBingWebApi } from '../services/apis/bing-web.mjs'
import {
generateAnswersWithChatgptApi,
generateAnswersWithOpenAiApi,
generateAnswersWithGptCompletionApi,
} from '../services/apis/openai-api'
import { generateAnswersWithCustomApi } from '../services/apis/custom-api.mjs'
Expand Down Expand Up @@ -65,7 +65,7 @@ const RECONNECT_CONFIG = {
}

const SENSITIVE_KEYWORDS = [
'apikey', // Covers apiKey, customApiKey, claudeApiKey, etc.
'apikey', // Covers apiKey, customApiKey, anthropicApiKey, etc.
'token', // Covers accessToken, refreshToken, etc.
'secret',
'password',
Expand Down Expand Up @@ -582,10 +582,10 @@ async function executeApi(session, port, config) {
const cookies = await getBardCookies()
await generateAnswersWithBardWebApi(port, session.question, session, cookies)
} else if (isUsingChatgptApiModel(session)) {
console.debug('[background] Using ChatGPT API Model')
await generateAnswersWithChatgptApi(port, session.question, session, config.apiKey)
console.debug('[background] Using OpenAI API Model')
await generateAnswersWithOpenAiApi(port, session.question, session, config.apiKey)
Comment on lines 584 to +586
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Find all usages of isUsingChatgptApiModel to scope the rename effort
rg -n "isUsingChatgptApiModel" --type=js --type=mjs -g '*.mjs' -g '*.js' -g '*.jsx'

Repository: ChatGPTBox-dev/chatGPTBox

Length of output: 96


🏁 Script executed:

#!/bin/bash
# Find all usages of isUsingChatgptApiModel using glob patterns
rg -n "isUsingChatgptApiModel" -g '*.mjs' -g '*.js' -g '*.jsx'

Repository: ChatGPTBox-dev/chatGPTBox

Length of output: 407


🏁 Script executed:

#!/bin/bash
# View the function definition and related code
sed -n '655,675p' src/config/index.mjs

Repository: ChatGPTBox-dev/chatGPTBox

Length of output: 723


🏁 Script executed:

#!/bin/bash
# View the context around line 584 in src/background/index.mjs
sed -n '570,600p' src/background/index.mjs

Repository: ChatGPTBox-dev/chatGPTBox

Length of output: 1709


🏁 Script executed:

#!/bin/bash
# Search for isUsingGptCompletionApiModel in background file
rg -n "isUsingGptCompletionApiModel" -A 3 src/background/index.mjs

Repository: ChatGPTBox-dev/chatGPTBox

Length of output: 482


The log message should specifically say "Using ChatGPT API Model" instead of "Using OpenAI API Model".

The guard condition at line 584 (isUsingChatgptApiModel) checks specifically for ChatGPT API models, but the log says "Using OpenAI API Model" which is misleading. GPT Completion API models are handled separately at line 621 with a different handler function (generateAnswersWithGptCompletionApi). The log should match the specific condition being checked.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/background/index.mjs` around lines 584 - 586, The log message is
misleading: when the guard is isUsingChatgptApiModel and you call
generateAnswersWithOpenAiApi, change the console.debug text to explicitly say
"Using ChatGPT API Model" to match the condition and handler; update the
console.debug('[background] Using OpenAI API Model') line to
console.debug('[background] Using ChatGPT API Model') (keep the same surrounding
context where isUsingChatgptApiModel and generateAnswersWithOpenAiApi(port,
session.question, session, config.apiKey) are used).

} else if (isUsingClaudeApiModel(session)) {
console.debug('[background] Using Claude API Model')
console.debug('[background] Using Anthropic API Model')
await generateAnswersWithClaudeApi(port, session.question, session)
Comment on lines 587 to 589
Copy link

Copilot AI Feb 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The debug log still says "Using Claude API Model", which is inconsistent with the updated API provider naming in this PR (Anthropic for API mode). Consider renaming this log message to "Using Anthropic API Model" for consistency.

Copilot uses AI. Check for mistakes.
} else if (isUsingMoonshotApiModel(session)) {
console.debug('[background] Using Moonshot API Model')
Expand Down
87 changes: 53 additions & 34 deletions src/config/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -156,11 +156,11 @@ export const ModelGroups = {

chatgptApiModelKeys: {
value: chatgptApiModelKeys,
desc: 'ChatGPT (API)',
desc: 'OpenAI (API)',
},
claudeApiModelKeys: {
value: claudeApiModelKeys,
desc: 'Claude.ai (API)',
desc: 'Anthropic (API)',
},
moonshotApiModelKeys: {
value: moonshotApiModelKeys,
Expand All @@ -176,7 +176,7 @@ export const ModelGroups = {
},
azureOpenAiApiModelKeys: {
value: azureOpenAiApiModelKeys,
desc: 'ChatGPT (Azure API)',
desc: 'Azure OpenAI (API)',
},
gptApiModelKeys: {
value: gptApiModelKeys,
Expand Down Expand Up @@ -220,75 +220,75 @@ export const Models = {
chatgptPlus4: { value: 'gpt-4', desc: 'ChatGPT (Web, GPT-4)' },
chatgptPlus4Browsing: { value: 'gpt-4', desc: 'ChatGPT (Web, GPT-4)' }, // for compatibility

chatgptApi35: { value: 'gpt-3.5-turbo', desc: 'ChatGPT (GPT-3.5-turbo)' },
chatgptApi35_16k: { value: 'gpt-3.5-turbo-16k', desc: 'ChatGPT (GPT-3.5-turbo-16k)' },
chatgptApi35: { value: 'gpt-3.5-turbo', desc: 'OpenAI (GPT-3.5-turbo)' },

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve translation keys for API model labels

modelNameToDesc translates model labels via t(Models[modelName].desc) (src/utils/model-name-convert.mjs), so changing the key text here from ChatGPT (...)/Claude.ai (...) to new strings without adding matching locale entries causes non-English locales to fall back to raw English labels in the API mode UI. This commit introduces that regression (e.g., existing locale keys like "ChatGPT (GPT-3.5-turbo)" are still present, but "OpenAI (GPT-3.5-turbo)" is not), and it also conflicts with AGENTS.md’s localization rule (“do not change keys”).

Useful? React with 👍 / 👎.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Add translations for renamed OpenAI model descriptor keys

Renaming model descriptors like ChatGPT (GPT-3.5-turbo) to OpenAI (GPT-3.5-turbo) changes the i18n lookup keys used by UI paths that render t(desc) (e.g., model selectors in popup/menu), but the locale files were not updated with these new keys. In non-English locales this regresses previously translated labels to raw English fallback (for example, src/_locales/ru/main.json still only defines the old ChatGPT (...) keys), so users lose localization for several existing model options.

Useful? React with 👍 / 👎.

chatgptApi35_16k: { value: 'gpt-3.5-turbo-16k', desc: 'OpenAI (GPT-3.5-turbo-16k)' },

chatgptApi4o_128k: { value: 'gpt-4o', desc: 'ChatGPT (GPT-4o, 128k)' },
chatgptApi4oMini: { value: 'gpt-4o-mini', desc: 'ChatGPT (GPT-4o mini)' },
chatgptApi4_8k: { value: 'gpt-4', desc: 'ChatGPT (GPT-4-8k)' },
chatgptApi4o_128k: { value: 'gpt-4o', desc: 'OpenAI (GPT-4o, 128k)' },
chatgptApi4oMini: { value: 'gpt-4o-mini', desc: 'OpenAI (GPT-4o mini)' },
chatgptApi4_8k: { value: 'gpt-4', desc: 'OpenAI (GPT-4-8k)' },
chatgptApi4_128k: {
value: 'gpt-4-turbo',
desc: 'ChatGPT (GPT-4-Turbo 128k)',
desc: 'OpenAI (GPT-4-Turbo 128k)',
},
chatgptApi4_128k_preview: {
value: 'gpt-4-turbo-preview',
desc: 'ChatGPT (GPT-4-Turbo 128k Preview)',
desc: 'OpenAI (GPT-4-Turbo 128k Preview)',
},
chatgptApi4_128k_1106_preview: {
value: 'gpt-4-1106-preview',
desc: 'ChatGPT (GPT-4-Turbo 128k 1106 Preview)',
desc: 'OpenAI (GPT-4-Turbo 128k 1106 Preview)',
},
chatgptApi4_128k_0125_preview: {
value: 'gpt-4-0125-preview',
desc: 'ChatGPT (GPT-4-Turbo 128k 0125 Preview)',
desc: 'OpenAI (GPT-4-Turbo 128k 0125 Preview)',
},
chatgptApi5Latest: { value: 'gpt-5-chat-latest', desc: 'ChatGPT (ChatGPT-5 latest)' },
chatgptApi5_1Latest: { value: 'gpt-5.1-chat-latest', desc: 'ChatGPT (ChatGPT-5.1 latest)' },
chatgptApi5Latest: { value: 'gpt-5-chat-latest', desc: 'OpenAI (GPT-5 latest)' },
chatgptApi5_1Latest: { value: 'gpt-5.1-chat-latest', desc: 'OpenAI (GPT-5.1 latest)' },
Comment on lines +245 to +246
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

OpenAI API models gpt-5-chat-latest gpt-5.1-chat-latest current documentation

💡 Result:

Current OpenAI API docs for gpt-5-chat-latest and gpt-5.1-chat-latest

Docs pages (official):

https://platform.openai.com/docs/models/gpt-5-chat-latest
https://platform.openai.com/docs/models/gpt-5.1-chat-latest

(platform.openai.com)

What these aliases mean (per docs):

  • gpt-5.1-chat-latest: points to the GPT‑5.1 snapshot currently used in ChatGPT. (platform.openai.com)
  • gpt-5-chat-latest: points to the GPT‑5 snapshot previously used in ChatGPT (i.e., older than GPT‑5.1 for “ChatGPT chat” usage). (platform.openai.com)

Key specs shown on the model pages (as of the current docs crawl):

  • Context window: 128,000
  • Max output tokens: 16,384
  • Knowledge cutoff shown: Sep 30, 2024
  • Token pricing shown: $1.25 / 1M input, $0.125 / 1M cached input, $10 / 1M output
  • Endpoints listed: Chat Completions (v1/chat/completions), Responses (v1/responses), plus others (Realtime, Assistants, Batch, etc.) (platform.openai.com)

Note from the general Models page:

  • These are categorized as “ChatGPT models” (models used in ChatGPT, not recommended for API use), and the docs list GPT‑5.1 as the generally recommended GPT‑5 family option for API work. (platform.openai.com)

Citations:


Verify that the description accurately reflects the model status.

Both gpt-5-chat-latest and gpt-5.1-chat-latest are valid OpenAI identifiers. However, the description 'OpenAI (GPT-5 latest)' on line 245 is misleading: gpt-5-chat-latest points to the GPT-5 snapshot previously used in ChatGPT, while gpt-5.1-chat-latest (line 246) points to the current GPT-5.1 snapshot actively used in ChatGPT.

Consider clarifying the description to distinguish the older snapshot from the current one, or ensure the configuration explicitly documents that gpt-5-chat-latest is a legacy option.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/config/index.mjs` around lines 245 - 246, Update the descriptions for the
two config entries to clearly distinguish the legacy GPT‑5 snapshot from the
current GPT‑5.1 snapshot: change the chatgptApi5Latest entry (symbol:
chatgptApi5Latest) to indicate it is a legacy/previous GPT‑5 snapshot (e.g.,
"OpenAI (GPT‑5 legacy snapshot)") and make chatgptApi5_1Latest (symbol:
chatgptApi5_1Latest) explicitly state it is the current GPT‑5.1 snapshot (e.g.,
"OpenAI (GPT‑5.1 latest snapshot)"); alternatively, add a short note in the
config comment documenting that chatgptApi5Latest is legacy.


chatgptApi4_1: { value: 'gpt-4.1', desc: 'ChatGPT (GPT-4.1)' },
chatgptApi4_1_mini: { value: 'gpt-4.1-mini', desc: 'ChatGPT (GPT-4.1 mini)' },
chatgptApi4_1_nano: { value: 'gpt-4.1-nano', desc: 'ChatGPT (GPT-4.1 nano)' },
chatgptApi4_1: { value: 'gpt-4.1', desc: 'OpenAI (GPT-4.1)' },
chatgptApi4_1_mini: { value: 'gpt-4.1-mini', desc: 'OpenAI (GPT-4.1 mini)' },
chatgptApi4_1_nano: { value: 'gpt-4.1-nano', desc: 'OpenAI (GPT-4.1 nano)' },

claude2WebFree: { value: '', desc: 'Claude.ai (Web)' },
claude3HaikuApi: {
value: 'claude-3-haiku-20240307',
desc: 'Claude.ai (API, Claude 3 Haiku)',
desc: 'Anthropic (API, Claude 3 Haiku)',
},
claude35HaikuApi: {
value: 'claude-3-5-haiku-20241022',
desc: 'Claude.ai (API, Claude 3.5 Haiku)',
desc: 'Anthropic (API, Claude 3.5 Haiku)',
},
claude37SonnetApi: {
value: 'claude-3-7-sonnet-20250219',
desc: 'Claude.ai (API, Claude 3.7 Sonnet)',
desc: 'Anthropic (API, Claude 3.7 Sonnet)',
},
claudeOpus4Api: {
value: 'claude-opus-4-20250514',
desc: 'Claude.ai (API, Claude Opus 4)',
desc: 'Anthropic (API, Claude Opus 4)',
},
claudeOpus41Api: {
value: 'claude-opus-4-1-20250805',
desc: 'Claude.ai (API, Claude Opus 4.1)',
desc: 'Anthropic (API, Claude Opus 4.1)',
},
claudeOpus45Api: {
value: 'claude-opus-4-5',
desc: 'Claude.ai (API, Claude Opus 4.5)',
desc: 'Anthropic (API, Claude Opus 4.5)',
},
claudeOpus46Api: {
value: 'claude-opus-4-6',
desc: 'Claude.ai (API, Claude Opus 4.6)',
desc: 'Anthropic (API, Claude Opus 4.6)',
},
claudeSonnet4Api: {
value: 'claude-sonnet-4-20250514',
desc: 'Claude.ai (API, Claude Sonnet 4)',
desc: 'Anthropic (API, Claude Sonnet 4)',
},
claudeSonnet45Api: {
value: 'claude-sonnet-4-5-20250929',
desc: 'Claude.ai (API, Claude Sonnet 4.5)',
desc: 'Anthropic (API, Claude Sonnet 4.5)',
},
claudeHaiku45Api: {
value: 'claude-haiku-4-5-20251001',
desc: 'Claude.ai (API, Claude Haiku 4.5)',
desc: 'Anthropic (API, Claude Haiku 4.5)',
},

bingFree4: { value: '', desc: 'Bing (Web, GPT-4)' },
Expand All @@ -311,15 +311,15 @@ export const Models = {
chatgptFree35Mobile: { value: 'text-davinci-002-render-sha-mobile', desc: 'ChatGPT (Mobile)' },
chatgptPlus4Mobile: { value: 'gpt-4-mobile', desc: 'ChatGPT (Mobile, GPT-4)' },

chatgptApi35_1106: { value: 'gpt-3.5-turbo-1106', desc: 'ChatGPT (GPT-3.5-turbo 1106)' },
chatgptApi35_0125: { value: 'gpt-3.5-turbo-0125', desc: 'ChatGPT (GPT-3.5-turbo 0125)' },
chatgptApi4_8k_0613: { value: 'gpt-4', desc: 'ChatGPT (GPT-4-8k 0613)' },
chatgptApi35_1106: { value: 'gpt-3.5-turbo-1106', desc: 'OpenAI (GPT-3.5-turbo 1106)' },
chatgptApi35_0125: { value: 'gpt-3.5-turbo-0125', desc: 'OpenAI (GPT-3.5-turbo 0125)' },
chatgptApi4_8k_0613: { value: 'gpt-4', desc: 'OpenAI (GPT-4-8k 0613)' },

gptApiInstruct: { value: 'gpt-3.5-turbo-instruct', desc: 'GPT-3.5-turbo Instruct' },

customModel: { value: '', desc: 'Custom Model' },
ollamaModel: { value: '', desc: 'Ollama API' },
azureOpenAi: { value: '', desc: 'ChatGPT (Azure)' },
azureOpenAi: { value: '', desc: 'Azure OpenAI' },
waylaidwandererApi: { value: '', desc: 'Waylaidwanderer API (Github)' },

poeAiWebSage: { value: 'Assistant', desc: 'Poe AI (Web, Assistant)' },
Expand Down Expand Up @@ -481,7 +481,7 @@ export const defaultConfig = {

poeCustomBotName: '',

claudeApiKey: '',
anthropicApiKey: '',
chatglmApiKey: '',
moonshotApiKey: '',
deepSeekApiKey: '',
Expand Down Expand Up @@ -511,7 +511,7 @@ export const defaultConfig = {
customChatGptWebApiUrl: 'https://chatgpt.com',
customChatGptWebApiPath: '/backend-api/conversation',
customOpenAiApiUrl: 'https://api.openai.com',
customClaudeApiUrl: 'https://api.anthropic.com',
customAnthropicApiUrl: 'https://api.anthropic.com',
disableWebModeHistory: true,
hideContextMenu: false,
cropText: true,
Expand Down Expand Up @@ -727,9 +727,28 @@ export async function getPreferredLanguageKey() {
* @returns {Promise<UserConfig>}
*/
export async function getUserConfig() {
const options = await Browser.storage.local.get(Object.keys(defaultConfig))
// Also fetch old keys for migration
const options = await Browser.storage.local.get([
...Object.keys(defaultConfig),
'claudeApiKey',
'customClaudeApiUrl',
])
if (options.customChatGptWebApiUrl === 'https://chat.openai.com')
options.customChatGptWebApiUrl = 'https://chatgpt.com'

// Migrate old keys to new names (persist new keys before removing old ones)
// Always migrate if old key exists to handle import of legacy backups
if (options.claudeApiKey !== undefined) {
options.anthropicApiKey = options.claudeApiKey
await Browser.storage.local.set({ anthropicApiKey: options.claudeApiKey })
Comment on lines +740 to +743
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The migration overwrites anthropicApiKey unconditionally whenever the legacy claudeApiKey key exists. If a user ends up with both keys present (e.g., after importing an old backup on a newer install), this can clobber the newer value. Prefer migrating only when anthropicApiKey is missing/empty, or otherwise keep the newer key and just remove the legacy one.

Suggested change
// Always migrate if old key exists to handle import of legacy backups
if (options.claudeApiKey !== undefined) {
options.anthropicApiKey = options.claudeApiKey
await Browser.storage.local.set({ anthropicApiKey: options.claudeApiKey })
// Only backfill anthropicApiKey from claudeApiKey if the new key is missing/empty
if (options.claudeApiKey !== undefined) {
const hasAnthropicApiKey =
options.anthropicApiKey !== undefined &&
options.anthropicApiKey !== null &&
options.anthropicApiKey !== ''
if (!hasAnthropicApiKey) {
options.anthropicApiKey = options.claudeApiKey
await Browser.storage.local.set({ anthropicApiKey: options.claudeApiKey })
}

Copilot uses AI. Check for mistakes.
await Browser.storage.local.remove('claudeApiKey')
Comment on lines +739 to +744
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New storage migration behavior was added for claudeApiKey/customClaudeApiUrl, but there are existing unit tests for getUserConfig migrations (e.g., the chat.openai.com -> chatgpt.com URL case). Please add tests covering the new key migrations (including that the old keys are removed and the new keys are set, and that newer keys are not overwritten when both exist).

Copilot uses AI. Check for mistakes.
}
if (options.customClaudeApiUrl !== undefined) {
options.customAnthropicApiUrl = options.customClaudeApiUrl
await Browser.storage.local.set({ customAnthropicApiUrl: options.customClaudeApiUrl })
Comment on lines +747 to +748
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same issue for the custom URL migration: if both customAnthropicApiUrl and legacy customClaudeApiUrl are present in storage, this logic will overwrite the newer URL. Consider only migrating when the new key is not set (or keep the new value and only remove the legacy key).

Suggested change
options.customAnthropicApiUrl = options.customClaudeApiUrl
await Browser.storage.local.set({ customAnthropicApiUrl: options.customClaudeApiUrl })
// Only migrate URL if new key is not already set; otherwise keep the newer value
if (options.customAnthropicApiUrl === undefined) {
options.customAnthropicApiUrl = options.customClaudeApiUrl
await Browser.storage.local.set({
customAnthropicApiUrl: options.customClaudeApiUrl,
})
}

Copilot uses AI. Check for mistakes.
await Browser.storage.local.remove('customClaudeApiUrl')
}

return defaults(options, defaultConfig)
}

Expand Down
6 changes: 3 additions & 3 deletions src/popup/sections/AdvancedPart.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,13 @@ function ApiUrl({ config, updateConfig }) {
/>
</label>
<label>
{t('Custom Claude API Url')}
{t('Custom Anthropic API Url')}
<input
type="text"
value={config.customClaudeApiUrl}
value={config.customAnthropicApiUrl}
onChange={(e) => {
const value = e.target.value
updateConfig({ customClaudeApiUrl: value })
updateConfig({ customAnthropicApiUrl: value })
}}
/>
</label>
Expand Down
6 changes: 3 additions & 3 deletions src/popup/sections/GeneralPart.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -290,11 +290,11 @@ export function GeneralPart({ config, updateConfig, setTabIndex }) {
<input
type="password"
style="width: 50%;"
value={config.claudeApiKey}
placeholder={t('Claude API Key')}
value={config.anthropicApiKey}
placeholder={t('Anthropic API Key')}
onChange={(e) => {
const apiKey = e.target.value
updateConfig({ claudeApiKey: apiKey })
updateConfig({ anthropicApiKey: apiKey })
}}
/>
)}
Expand Down
Loading