Correct LLM provider naming for OpenAI/Anthropic API modes#928
Correct LLM provider naming for OpenAI/Anthropic API modes#928PeterDaveHello wants to merge 1 commit intomasterfrom
Conversation
📝 WalkthroughWalkthroughRenames provider terminology and API function identifiers: ChatGPT → OpenAI and Claude.ai → Anthropic. Updates include locale key renames/additions, model descriptor text changes, config key migrations, service function renames and updated call sites, popup label updates, and a related test rename. Changes
Sequence Diagram(s)(omitted) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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. Comment |
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||
Summary of ChangesHello @PeterDaveHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request refines the naming conventions for Large Language Model (LLM) providers within the application, specifically differentiating between API access and web product interfaces. The primary goal is to standardize terminology, using 'OpenAI API' and 'Anthropic API' for programmatic access while retaining 'ChatGPT' and 'Claude' for their respective web-based products. This change improves clarity and consistency for users interacting with various LLM services. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||||
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fa574556af
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| 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)' }, |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
Actionable comments posted: 6
🧹 Nitpick comments (5)
src/services/apis/openai-api.mjs (1)
17-17:generateAnswersWithGptCompletionApinot aligned with the new OpenAI naming convention.The rest of the file now uses
generateAnswersWithOpenAi*prefixes, but this legacy completions endpoint function still carries theGptprefix, which is inconsistent. Consider renaming togenerateAnswersWithOpenAiGptCompletionApiorgenerateAnswersWithOpenAiCompletionApifor uniformity.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/services/apis/openai-api.mjs` at line 17, The function name generateAnswersWithGptCompletionApi is inconsistent with the file's OpenAI naming convention; rename the function and its exported identifier to a consistent name such as generateAnswersWithOpenAiCompletionApi (or generateAnswersWithOpenAiGptCompletionApi if you want to keep "Gpt" in the name), and update all references/imports/exports to use the new identifier (search for generateAnswersWithGptCompletionApi and replace occurrences in this module and any modules importing it, keeping the function body and signature unchanged).src/_locales/ru/main.json (1)
137-137: Optional: translate the"Anthropic API Key"value.Line 85 translates generic
"API Key"as"Ключ API", but this entry keeps the English value."Ключ API Anthropic"would be consistent with the Russian locale style.♻️ Suggested translation
- "Anthropic API Key": "Anthropic API Key", + "Anthropic API Key": "Ключ API Anthropic",🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/_locales/ru/main.json` at line 137, The value for the JSON key "Anthropic API Key" is still in English; update its translated value to match the Russian locale style (e.g., change the value to "Ключ API Anthropic") so it is consistent with the other "API Key" translations; locate the entry with the key "Anthropic API Key" in src/_locales/ru/main.json and replace the English string value with the Russian translation.src/_locales/tr/main.json (1)
137-137: Optional: translate the"Anthropic API Key"value.The generic
"API Key"at Line 85 is translated as"API Anahtarı", but the new"Anthropic API Key"entry keeps its English value. Consider"Anthropic API Anahtarı"for internal consistency within the Turkish locale.♻️ Suggested translation
- "Anthropic API Key": "Anthropic API Key", + "Anthropic API Key": "Anthropic API Anahtarı",🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/_locales/tr/main.json` at line 137, Update the Turkish translation for the "Anthropic API Key" locale entry: replace the current English value "Anthropic API Key" with the Turkish equivalent "Anthropic API Anahtarı" so it matches the existing translation style (e.g., "API Key" => "API Anahtarı") and keep the JSON key "Anthropic API Key" unchanged to preserve lookup.src/_locales/fr/main.json (1)
137-137: Optional: translate the"Anthropic API Key"value.Line 85 translates
"API Key"as"Clé API", but this entry keeps the English value."Clé API Anthropic"would be consistent with the French locale style.♻️ Suggested translation
- "Anthropic API Key": "Anthropic API Key", + "Anthropic API Key": "Clé API Anthropic",🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/_locales/fr/main.json` at line 137, Translate the JSON value for the "Anthropic API Key" entry to French to match the locale style; update the value for the key "Anthropic API Key" from the English string to the French translation (e.g., "Clé API Anthropic") so it is consistent with the existing "API Key" -> "Clé API" translation.src/config/index.mjs (1)
253-291: LGTM — all Anthropic provider desc renames are correct and consistent.The prior concern about
claudeSonnet45Api's identifier is resolved: Claude Sonnet 4.5 is available via the Claude API using model stringclaude-sonnet-4-5-20250929.As a pre-existing side-note (not introduced by this PR):
claudeOpus45ApiandclaudeOpus46Apiuse undated bare identifiers (claude-opus-4-5,claude-opus-4-6), which can producemodel_not_founderrors when routed through a custom base URL or proxy that requires full snapshot IDs. All other Anthropic entries in this group use dated snapshot identifiers — consider adding snapshot dates when those models stabilize.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/config/index.mjs` around lines 253 - 291, The two Anthropic entries claudeOpus45Api and claudeOpus46Api currently use undated bare model identifiers ('claude-opus-4-5' and 'claude-opus-4-6') which can cause model_not_found errors when using custom base URLs/proxies; update the value fields for claudeOpus45Api and claudeOpus46Api in the config (src/config/index.mjs) to the full dated snapshot model strings once the stable snapshot IDs are known (matching the pattern used by other entries such as claudeSonnet45Api), or if snapshot IDs are not yet available add a clear TODO comment and implement a safe fallback (e.g., detect proxy mode and avoid using bare identifiers) so the app doesn't route undated names through proxies.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/_locales/en/main.json`:
- Around line 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.
In `@src/_locales/es/main.json`:
- Line 137: The JSON entry with key "Anthropic API Key" currently has an
untranslated value; update the value for the "Anthropic API Key" entry (the
string key "Anthropic API Key") in src/_locales/es/main.json to the Spanish
translation "Anthropic Clave de API" so it matches the existing translation
style (keep the brand name and translate the descriptor).
- Around line 136-137: The Spanish locale has the value for the key "Anthropic
API Key" left in English; update the value for the JSON key "Anthropic API Key"
in es/main.json to a proper Spanish translation such as "Clave de la API de
Anthropic" (matching the pattern used for "Custom Anthropic API Url"/"URL
personalizada de la API de Anthropic") so the localization is complete.
In `@src/_locales/ja/main.json`:
- 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.
In `@src/background/index.mjs`:
- Around line 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).
In `@src/config/index.mjs`:
- Around line 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.
---
Nitpick comments:
In `@src/_locales/fr/main.json`:
- Line 137: Translate the JSON value for the "Anthropic API Key" entry to French
to match the locale style; update the value for the key "Anthropic API Key" from
the English string to the French translation (e.g., "Clé API Anthropic") so it
is consistent with the existing "API Key" -> "Clé API" translation.
In `@src/_locales/ru/main.json`:
- Line 137: The value for the JSON key "Anthropic API Key" is still in English;
update its translated value to match the Russian locale style (e.g., change the
value to "Ключ API Anthropic") so it is consistent with the other "API Key"
translations; locate the entry with the key "Anthropic API Key" in
src/_locales/ru/main.json and replace the English string value with the Russian
translation.
In `@src/_locales/tr/main.json`:
- Line 137: Update the Turkish translation for the "Anthropic API Key" locale
entry: replace the current English value "Anthropic API Key" with the Turkish
equivalent "Anthropic API Anahtarı" so it matches the existing translation style
(e.g., "API Key" => "API Anahtarı") and keep the JSON key "Anthropic API Key"
unchanged to preserve lookup.
In `@src/config/index.mjs`:
- Around line 253-291: The two Anthropic entries claudeOpus45Api and
claudeOpus46Api currently use undated bare model identifiers ('claude-opus-4-5'
and 'claude-opus-4-6') which can cause model_not_found errors when using custom
base URLs/proxies; update the value fields for claudeOpus45Api and
claudeOpus46Api in the config (src/config/index.mjs) to the full dated snapshot
model strings once the stable snapshot IDs are known (matching the pattern used
by other entries such as claudeSonnet45Api), or if snapshot IDs are not yet
available add a clear TODO comment and implement a safe fallback (e.g., detect
proxy mode and avoid using bare identifiers) so the app doesn't route undated
names through proxies.
In `@src/services/apis/openai-api.mjs`:
- Line 17: The function name generateAnswersWithGptCompletionApi is inconsistent
with the file's OpenAI naming convention; rename the function and its exported
identifier to a consistent name such as generateAnswersWithOpenAiCompletionApi
(or generateAnswersWithOpenAiGptCompletionApi if you want to keep "Gpt" in the
name), and update all references/imports/exports to use the new identifier
(search for generateAnswersWithGptCompletionApi and replace occurrences in this
module and any modules importing it, keeping the function body and signature
unchanged).
| "Custom Anthropic API Url": "Custom Anthropic API Url", | ||
| "Anthropic API Key": "Anthropic API Key", |
There was a problem hiding this comment.
🧩 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.
src/_locales/es/main.json
Outdated
| "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": "Anthropic API Key", |
There was a problem hiding this comment.
"Anthropic API Key" value is untranslated.
The existing entry "API Key": "Clave de API" at line 85 translates the term, but the new entry uses the English string as-is. For consistency, the value should be "Anthropic Clave de API" (keeping the brand name, translating the descriptor).
🌐 Suggested fix
- "Anthropic API Key": "Anthropic API Key",
+ "Anthropic API Key": "Anthropic Clave de 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.
| "Anthropic API Key": "Anthropic API Key", | |
| "Anthropic API Key": "Anthropic Clave de API", |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/_locales/es/main.json` at line 137, The JSON entry with key "Anthropic
API Key" currently has an untranslated value; update the value for the
"Anthropic API Key" entry (the string key "Anthropic API Key") in
src/_locales/es/main.json to the Spanish translation "Anthropic Clave de API" so
it matches the existing translation style (keep the brand name and translate the
descriptor).
| "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 キー", |
There was a problem hiding this comment.
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.
| "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.
| } 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) |
There was a problem hiding this comment.
🧩 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.mjsRepository: 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.mjsRepository: 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.mjsRepository: 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).
| 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)' }, |
There was a problem hiding this comment.
🧩 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
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:
- 1: https://platform.openai.com/docs/models/gpt-5-chat-latest?utm_source=openai
- 2: https://platform.openai.com/docs/models/gpt-5.1-chat-latest?utm_source=openai
- 3: https://platform.openai.com/docs/models/gpt-5-chat-latest?utm_source=openai
- 4: https://platform.openai.com/docs/models/gpt-5-chat-latest?utm_source=openai
- 5: https://platform.openai.com/docs/models?utm_source=openai
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.
There was a problem hiding this comment.
Pull request overview
This PR updates API-mode provider terminology across the extension to use “OpenAI” / “Anthropic” for API access (while keeping product names for web modes), and aligns internal function names and UI strings accordingly.
Changes:
- Renames OpenAI API helper functions (
generateAnswersWithChatgptApi*→generateAnswersWithOpenAiApi*) and updates all call sites/tests. - Updates model group/model display descriptions for API providers (ChatGPT API → OpenAI API, Claude API → Anthropic API, Azure naming).
- Updates UI + i18n strings for Anthropic API settings, including adding the missing “Anthropic API Key” locale entry.
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
src/services/apis/openai-api.mjs |
Renames exported OpenAI API functions to “OpenAi” terminology. |
src/background/index.mjs |
Switches background execution path to call renamed OpenAI API function + updates related debug log. |
src/services/apis/openrouter-api.mjs |
Updates OpenRouter wrapper to call renamed OpenAI-compat helper. |
src/services/apis/aiml-api.mjs |
Updates AIML wrapper to call renamed OpenAI-compat helper. |
src/services/apis/chatglm-api.mjs |
Updates ChatGLM wrapper to call renamed OpenAI-compat helper. |
src/services/apis/deepseek-api.mjs |
Updates DeepSeek wrapper to call renamed OpenAI-compat helper. |
src/services/apis/moonshot-api.mjs |
Updates Moonshot wrapper to call renamed OpenAI-compat helper. |
src/services/apis/ollama-api.mjs |
Updates Ollama wrapper to call renamed OpenAI-compat helper. |
src/popup/sections/AdvancedPart.jsx |
Updates UI label to “Custom Anthropic API Url”. |
src/popup/sections/GeneralPart.jsx |
Updates Claude API key placeholder to “Anthropic API Key”. |
src/config/index.mjs |
Updates API-mode model/group display names to OpenAI/Anthropic/Azure OpenAI wording. |
tests/unit/services/apis/openai-api-compat.test.mjs |
Updates tests to use renamed OpenAI-compat function name. |
src/_locales/en/main.json |
Adds “Anthropic API Key” and renames “Custom Claude API Url” → “Custom Anthropic API Url”. |
src/_locales/de/main.json |
Same as above (German). |
src/_locales/es/main.json |
Same as above (Spanish). |
src/_locales/fr/main.json |
Same as above (French). |
src/_locales/in/main.json |
Same as above (Indonesian). |
src/_locales/it/main.json |
Same as above (Italian). |
src/_locales/ja/main.json |
Same as above (Japanese). |
src/_locales/ko/main.json |
Same as above (Korean). |
src/_locales/pt/main.json |
Same as above (Portuguese). |
src/_locales/ru/main.json |
Same as above (Russian). |
src/_locales/tr/main.json |
Same as above (Turkish). |
src/_locales/zh-hans/main.json |
Same as above (Simplified Chinese). |
src/_locales/zh-hant/main.json |
Same as above (Traditional Chinese). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } else if (isUsingClaudeApiModel(session)) { | ||
| console.debug('[background] Using Claude API Model') | ||
| await generateAnswersWithClaudeApi(port, session.question, session) |
There was a problem hiding this comment.
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.
src/_locales/es/main.json
Outdated
| "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": "Anthropic API Key", |
There was a problem hiding this comment.
This locale file translates "API Key" (see earlier entry), but the newly added "Anthropic API Key" value is left in English. Please localize it to match the rest of this locale.
| "Anthropic API Key": "Anthropic API Key", | |
| "Anthropic API Key": "Clave de API de Anthropic", |
src/_locales/pt/main.json
Outdated
| "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": "Anthropic API Key", |
There was a problem hiding this comment.
This locale file translates "API Key" (see earlier entry), but the newly added "Anthropic API Key" value is left in English. Please localize it to match the rest of this locale.
| "Anthropic API Key": "Anthropic API Key", | |
| "Anthropic API Key": "Chave de API da Anthropic", |
src/_locales/de/main.json
Outdated
| "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 Key", |
There was a problem hiding this comment.
This locale file translates "API Key" (see earlier entry), but the newly added "Anthropic API Key" value is left in English. Please localize it to match the rest of this locale.
| "Anthropic API Key": "Anthropic API Key", | |
| "Anthropic API Key": "Anthropic-API-Schlüssel", |
src/_locales/fr/main.json
Outdated
| "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": "Anthropic API Key", |
There was a problem hiding this comment.
This locale file translates "API Key" (see earlier entry), but the newly added "Anthropic API Key" value is left in English. Please localize it to match the rest of this locale.
| "Anthropic API Key": "Anthropic API Key", | |
| "Anthropic API Key": "Clé API Anthropic", |
src/_locales/in/main.json
Outdated
| "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": "Anthropic API Key", |
There was a problem hiding this comment.
This locale file translates "API Key" (see earlier entry), but the newly added "Anthropic API Key" value is left in English. Please localize it to match the rest of this locale.
| "Anthropic API Key": "Anthropic API Key", | |
| "Anthropic API Key": "Kunci API Anthropic", |
src/_locales/it/main.json
Outdated
| "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": "Anthropic API Key", |
There was a problem hiding this comment.
This locale file translates "API Key" (see earlier entry), but the newly added "Anthropic API Key" value is left in English. Please localize it to match the rest of this locale.
| "Anthropic API Key": "Anthropic API Key", | |
| "Anthropic API Key": "Chiave API Anthropic", |
src/_locales/ru/main.json
Outdated
| "Hide context menu of this extension": "Скрыть контекстное меню этого расширения", | ||
| "Custom Claude API Url": "Пользовательский URL API Claude", | ||
| "Custom Anthropic API Url": "Пользовательский URL API Anthropic", | ||
| "Anthropic API Key": "Anthropic API Key", |
There was a problem hiding this comment.
This locale file translates "API Key" (see earlier entry), but the newly added "Anthropic API Key" value is left in English. Please localize it to match the rest of this locale.
| "Anthropic API Key": "Anthropic API Key", | |
| "Anthropic API Key": "Ключ API Anthropic", |
src/_locales/tr/main.json
Outdated
| "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 Key", |
There was a problem hiding this comment.
This locale file translates "API Key" (see earlier entry), but the newly added "Anthropic API Key" value is left in English. Please localize it to match the rest of this locale.
| "Anthropic API Key": "Anthropic API Key", | |
| "Anthropic API Key": "Anthropic API Anahtarı", |
There was a problem hiding this comment.
Code Review
This pull request is a great step towards improving consistency by renaming LLM providers to use standard industry terminology for API access. The changes across the UI, internal functions, and locale files are well-executed. My main feedback is regarding the new locale strings, where the value for Anthropic API Key has been left untranslated in several language files. I've added specific comments with translation suggestions for each affected file.
src/_locales/de/main.json
Outdated
| "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 Key", |
src/_locales/es/main.json
Outdated
| "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": "Anthropic API Key", |
src/_locales/fr/main.json
Outdated
| "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": "Anthropic API Key", |
src/_locales/in/main.json
Outdated
| "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": "Anthropic API Key", |
src/_locales/it/main.json
Outdated
| "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": "Anthropic API Key", |
src/_locales/pt/main.json
Outdated
| "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": "Anthropic API Key", |
src/_locales/ru/main.json
Outdated
| "Hide context menu of this extension": "Скрыть контекстное меню этого расширения", | ||
| "Custom Claude API Url": "Пользовательский URL API Claude", | ||
| "Custom Anthropic API Url": "Пользовательский URL API Anthropic", | ||
| "Anthropic API Key": "Anthropic API Key", |
src/_locales/tr/main.json
Outdated
| "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 Key", |
There was a problem hiding this comment.
Actionable comments posted: 7
🧹 Nitpick comments (1)
src/_locales/en/main.json (1)
182-192: Claude Sonnet 4.6 (released Feb 17, 2026) is not included.The locale keys cover up to Anthropic (API, Claude Opus 4.6) and Sonnet 4.5, but
"Anthropic (API, Claude Sonnet 4.6)"— released on February 17, 2026, just five days before this PR — is absent. This gap applies to all locale files.Do you want me to open a follow-up issue to track adding the Sonnet 4.6 entry?
🤖 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 182 - 192, Add the missing locale entry for the newly released model by inserting the key "Anthropic (API, Claude Sonnet 4.6)" with the same value into the locale JSONs (it should mirror existing entries like "Anthropic (API, Claude Sonnet 4.5)"); update src/_locales/en/main.json and propagate the identical key/value to all other locale files to keep translations synchronized. Ensure the new key is placed in the Anthropic block to maintain ordering and run a JSON lint/check to confirm no trailing commas or syntax errors.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/_locales/en/main.json`:
- Line 164: The new localization key "Crop Text to ensure the input tokens do
not exceed the model's limit" was only added to en/main.json (and exists in
zh-hans/ and zh-hant/) but must be propagated to all other locale files; add
this exact key to each locale's main.json (de, es, fr, in, it, ja, ko, pt, ru,
tr) using either the proper translated string or the English text as a
placeholder, ensure valid JSON formatting (proper quoting, commas) and keep the
key/value identical in structure to the entry in en/main.json so automated
checks pass.
In `@src/_locales/fr/main.json`:
- Line 137: The JSON value for the key "Anthropic API Key" is still in English;
update its translated value to match the existing pattern used for "API Key"
(line with "Clé API") by replacing the English string with the French
translation, e.g., set the value to "Clé API Anthropic" for the "Anthropic API
Key" entry.
In `@src/_locales/in/main.json`:
- Line 137: The locale entry for the key "Anthropic API Key" has an untranslated
value (it currently duplicates the English key); update the value to the
Indonesian translation consistent with the existing pattern (e.g., use "Kunci
API Anthropic" or the same word order used elsewhere) so the pair becomes
"Anthropic API Key": "Kunci API Anthropic" (ensure the JSON string key stays
exactly "Anthropic API Key" and only the value is changed).
In `@src/_locales/pt/main.json`:
- Line 137: The translation value for the JSON key "Anthropic API Key" is still
in English; update its value to match the existing pattern used for "API Key"
(line with "Chave API") by replacing the English string with the Portuguese
translation, e.g., "Chave API Anthropic", so the entry becomes "Anthropic API
Key": "Chave API Anthropic".
In `@src/_locales/ru/main.json`:
- Line 137: The JSON entry with the key "Anthropic API Key" has an untranslated
value; update its value to the Russian equivalent consistent with the existing
"API Key" translation (use "Ключ API Anthropic" or "Ключ API для Anthropic") so
the entry reads "Anthropic API Key": "Ключ API Anthropic" (or "Ключ API для
Anthropic") to match the translation pattern used for "API Key".
In `@src/_locales/tr/main.json`:
- Line 137: The JSON entry with the key "Anthropic API Key" has an untranslated
value; update the value to the Turkish translation consistent with the existing
"API Key" translation (use "Anthropic API Anahtarı") so the pair reads
"Anthropic API Key": "Anthropic API Anahtarı" and matches the project's
translation pattern.
In `@src/_locales/zh-hans/main.json`:
- Line 170: Add the missing localization key "Thinking Content" into the source
locale en/main.json first (with its English value "Thinking Content"), then
propagate that key and corresponding translations to all other locale files
(including it, ja, ko, de, etc.) so no locale falls back to the raw key; update
zh-hans and zh-hant to remain consistent after propagation.
---
Duplicate comments:
In `@src/_locales/en/main.json`:
- Around line 136-137: The key "Custom Anthropic API Url" in en/main.json was
introduced by renaming the existing "Custom Claude API Url" which breaks the "Do
not change keys" rule; revert the original key "Custom Claude API Url" back to
its exact previous name and instead add a new separate entry for "Custom
Anthropic API Url" (and similarly restore "Anthropic API Key" if it replaced
"Claude API Key") so both keys coexist; update only the values if needed but do
not mutate existing key names (look for the string keys "Custom Claude API Url",
"Custom Anthropic API Url", "Claude API Key", and "Anthropic API Key" to locate
the changes).
In `@src/_locales/es/main.json`:
- Line 137: The Spanish translation file still has the English value for the
"Anthropic API Key" entry; update the value for the JSON key "Anthropic API Key"
in src/_locales/es/main.json to the Spanish translation (for example "Anthropic
Clave de API") so the key remains unchanged but the localized string is
translated.
In `@src/_locales/ja/main.json`:
- Line 137: The translation for the "Anthropic API Key" entry is inconsistent
with the existing "API Key" translation—remove the extra space so the value
becomes "Anthropic APIキー" to match the style used in the "API Key" -> "APIキー"
entry; update the value for the "Anthropic API Key" key accordingly (look for
the "Anthropic API Key" JSON property in main.json).
---
Nitpick comments:
In `@src/_locales/en/main.json`:
- Around line 182-192: Add the missing locale entry for the newly released model
by inserting the key "Anthropic (API, Claude Sonnet 4.6)" with the same value
into the locale JSONs (it should mirror existing entries like "Anthropic (API,
Claude Sonnet 4.5)"); update src/_locales/en/main.json and propagate the
identical key/value to all other locale files to keep translations synchronized.
Ensure the new key is placed in the Anthropic block to maintain ordering and run
a JSON lint/check to confirm no trailing commas or syntax errors.
0ac6a6e to
7e1ad20
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
src/background/index.mjs (1)
584-589: Log messages correctly updated; minor naming inconsistency with the guard function.The
console.debugand call-site changes are correct and intentional. However, the guard at Line 584 is stillisUsingChatgptApiModelwhile the log now reads"Using OpenAI API Model". The function is not renamed in this PR (unlikegenerateAnswersWithChatgptApi→generateAnswersWithOpenAiApi), creating a semantic gap that could confuse future readers. Consider renaming it — noting thatisUsingOpenAiApiModel(Line 668 ofconfig/index.mjs) already exists as the broader union function, so the renamed version would need a distinct name likeisUsingOpenAiChatCompletionApiModel.🤖 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 - 589, The guard function name is inconsistent with the new OpenAI naming: change the predicate isUsingChatgptApiModel to a clearer name like isUsingOpenAiChatCompletionApiModel (or similar) and update all call sites (e.g., the conditional that now logs "Using OpenAI API Model" and calls generateAnswersWithOpenAiApi) to use the new name; also update its export/imports and any references alongside the existing isUsingOpenAiApiModel union so there’s no ambiguity.src/_locales/pt/main.json (1)
73-78: Stale model description keys after the ChatGPT → OpenAI rename.Lines 76–78 (
"ChatGPT (GPT-3.5-turbo)","ChatGPT (GPT-4-8k)","ChatGPT (GPT-4-32k)") are now unreachable —src/config/index.mjschanged thosedescvalues to"OpenAI (GPT-3.5-turbo)","OpenAI (GPT-4-8k)", etc. Leaving them in the file is harmless (i18next falls back to the key for unmapped strings), but they're dead weight.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/_locales/pt/main.json` around lines 73 - 78, The JSON contains stale localization keys using "ChatGPT (...)" that no longer map to any description in src/config/index.mjs (which now uses "OpenAI (...)" values); remove the dead entries for "ChatGPT (GPT-3.5-turbo)", "ChatGPT (GPT-4-8k)", and "ChatGPT (GPT-4-32k)" from src/_locales/pt/main.json or replace them with the updated keys "OpenAI (GPT-3.5-turbo)", "OpenAI (GPT-4-8k)", and "OpenAI (GPT-4-32k)" so the locale file matches the desc values used by the application.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/_locales/it/main.json`:
- Line 137: The value for the JSON key "Anthropic API Key" is untranslated;
update its value to the Italian translation following the existing pattern used
for "API Key" (e.g., "Chiave API Anthropic" or "Chiave API di Anthropic") so the
entry becomes "Anthropic API Key": "Chiave API Anthropic" (or your chosen
Italian variant) in src/_locales/it/main.json.
---
Duplicate comments:
In `@src/_locales/fr/main.json`:
- Line 137: The French value for the "Anthropic API Key" entry is still in
English; update the value for the "Anthropic API Key" key to a proper French
translation (e.g., "Clé API Anthropic" or "Clé API pour Anthropic") to match the
existing translation style used for the "API Key" key.
In `@src/_locales/pt/main.json`:
- Line 137: The localization value for the key "Anthropic API Key" is
untranslated; update its value to Portuguese while keeping the product name
"Anthropic" intact (e.g., change the value to "Chave API Anthropic" to match the
existing "API Key": "Chave API" pattern), ensuring punctuation/quotes remain
unchanged.
In `@src/_locales/ru/main.json`:
- Line 137: The JSON entry with key "Anthropic API Key" currently has an English
value; replace its value with the Russian translation matching the project's
convention (use "Ключ API Anthropic" or similar), ensuring the key remains
unchanged ("Anthropic API Key") and the value is properly quoted to keep valid
JSON in main.json.
In `@src/config/index.mjs`:
- Around line 245-246: The two config entries chatgptApi5Latest and
chatgptApi5_1Latest are labeled as "latest" but are snapshots/legacy (GPT‑5.2 is
now current); update their desc fields to remove "latest" and clearly mark them
as snapshot/legacy/deprecated (e.g., "OpenAI (GPT‑5 snapshot, legacy)" and
"OpenAI (GPT‑5.1 snapshot, legacy)") so the UI/config no longer misleads; keep
the value fields the same but ensure descriptions for chatgptApi5Latest and
chatgptApi5_1Latest reflect they are not the current flagship model.
---
Nitpick comments:
In `@src/_locales/pt/main.json`:
- Around line 73-78: The JSON contains stale localization keys using "ChatGPT
(...)" that no longer map to any description in src/config/index.mjs (which now
uses "OpenAI (...)" values); remove the dead entries for "ChatGPT
(GPT-3.5-turbo)", "ChatGPT (GPT-4-8k)", and "ChatGPT (GPT-4-32k)" from
src/_locales/pt/main.json or replace them with the updated keys "OpenAI
(GPT-3.5-turbo)", "OpenAI (GPT-4-8k)", and "OpenAI (GPT-4-32k)" so the locale
file matches the desc values used by the application.
In `@src/background/index.mjs`:
- Around line 584-589: The guard function name is inconsistent with the new
OpenAI naming: change the predicate isUsingChatgptApiModel to a clearer name
like isUsingOpenAiChatCompletionApiModel (or similar) and update all call sites
(e.g., the conditional that now logs "Using OpenAI API Model" and calls
generateAnswersWithOpenAiApi) to use the new name; also update its
export/imports and any references alongside the existing isUsingOpenAiApiModel
union so there’s no ambiguity.
|
@codex review |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 25 out of 25 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7e1ad20122
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| 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)' }, |
There was a problem hiding this comment.
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 👍 / 👎.
- ChatGPT (API) -> OpenAI (API) - ChatGPT (Azure API) -> Azure OpenAI (API) - Claude.ai (API) -> Anthropic (API) - Rename generateAnswersWithChatgptApi -> generateAnswersWithOpenAiApi - Rename config keys: claudeApiKey -> anthropicApiKey, customClaudeApiUrl -> customAnthropicApiUrl - Add migration logic for existing user settings - Add localized translations for 'Anthropic API Key' OpenAI and Anthropic are the commonly used terms for API access. Product names like ChatGPT and Claude are appropriate for web interfaces, but less precise for API settings.
7e1ad20 to
59f5b50
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 26 out of 26 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // 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 }) |
There was a problem hiding this comment.
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.
| // 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 }) | |
| } |
| options.customAnthropicApiUrl = options.customClaudeApiUrl | ||
| await Browser.storage.local.set({ customAnthropicApiUrl: options.customClaudeApiUrl }) |
There was a problem hiding this comment.
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).
| 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, | |
| }) | |
| } |
| // 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 }) | ||
| await Browser.storage.local.remove('claudeApiKey') |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
♻️ Duplicate comments (1)
src/config/index.mjs (1)
245-246: Existing concern:'OpenAI (GPT-5 latest)'description may still mislead.
gpt-5-chat-latestresolves to the previous GPT-5 ChatGPT snapshot, whilegpt-5.1-chat-latest(line 246) is the more current one. Calling both "latest" without qualification can confuse users choosing between the two.🤖 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, The descriptions for chatgptApi5Latest and chatgptApi5_1Latest are misleading; update the desc for chatgptApi5Latest to indicate it refers to the previous/legacy GPT‑5 snapshot (e.g., "OpenAI (GPT‑5 previous snapshot / legacy)") and make chatgptApi5_1Latest explicitly "OpenAI (GPT‑5.1 latest/current)" so users can distinguish which entry is the current model; locate the two config entries named chatgptApi5Latest and chatgptApi5_1Latest and change only their desc strings accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@src/config/index.mjs`:
- Around line 245-246: The descriptions for chatgptApi5Latest and
chatgptApi5_1Latest are misleading; update the desc for chatgptApi5Latest to
indicate it refers to the previous/legacy GPT‑5 snapshot (e.g., "OpenAI (GPT‑5
previous snapshot / legacy)") and make chatgptApi5_1Latest explicitly "OpenAI
(GPT‑5.1 latest/current)" so users can distinguish which entry is the current
model; locate the two config entries named chatgptApi5Latest and
chatgptApi5_1Latest and change only their desc strings accordingly.
ℹ️ Review info
Configuration used: defaults
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (26)
src/_locales/de/main.jsonsrc/_locales/en/main.jsonsrc/_locales/es/main.jsonsrc/_locales/fr/main.jsonsrc/_locales/in/main.jsonsrc/_locales/it/main.jsonsrc/_locales/ja/main.jsonsrc/_locales/ko/main.jsonsrc/_locales/pt/main.jsonsrc/_locales/ru/main.jsonsrc/_locales/tr/main.jsonsrc/_locales/zh-hans/main.jsonsrc/_locales/zh-hant/main.jsonsrc/background/index.mjssrc/config/index.mjssrc/popup/sections/AdvancedPart.jsxsrc/popup/sections/GeneralPart.jsxsrc/services/apis/aiml-api.mjssrc/services/apis/chatglm-api.mjssrc/services/apis/claude-api.mjssrc/services/apis/deepseek-api.mjssrc/services/apis/moonshot-api.mjssrc/services/apis/ollama-api.mjssrc/services/apis/openai-api.mjssrc/services/apis/openrouter-api.mjstests/unit/services/apis/openai-api-compat.test.mjs
🚧 Files skipped from review as they are similar to previous changes (16)
- src/services/apis/chatglm-api.mjs
- src/popup/sections/AdvancedPart.jsx
- src/services/apis/deepseek-api.mjs
- src/background/index.mjs
- src/_locales/ja/main.json
- src/_locales/ru/main.json
- src/_locales/en/main.json
- src/_locales/it/main.json
- src/_locales/de/main.json
- src/_locales/pt/main.json
- src/_locales/ko/main.json
- src/_locales/es/main.json
- src/_locales/fr/main.json
- src/_locales/in/main.json
- src/_locales/tr/main.json
- src/services/apis/ollama-api.mjs
User description
Summary
Corrects LLM provider naming to follow common terminology: OpenAI API and Anthropic API for API access, while keeping ChatGPT and Claude for web products.
Changes
UI Display Names:
ChatGPT (API)→OpenAI (API)ChatGPT (Azure API)→Azure OpenAI (API)Claude.ai (API)→Anthropic (API)(all Claude API model variants)Locale Strings:
Custom Claude API Url→Custom Anthropic API UrlAnthropic API Keywith translations in all 13 localesInternal Code:
generateAnswersWithChatgptApi→generateAnswersWithOpenAiApigenerateAnswersWithChatgptApiCompat→generateAnswersWithOpenAiApiCompatConfig Keys:
claudeApiKey→anthropicApiKeycustomClaudeApiUrl→customAnthropicApiUrlUnchanged:
ChatGPT (Web),Claude.ai (Web)) - these refer to web productsRationale
"OpenAI API" and "Anthropic API" are the commonly used terms when referring to programmatic API access. Product names like ChatGPT and Claude are appropriate for web interfaces, but less precise for API settings.
PR Type
Enhancement
Description
Rename LLM provider display names to use company names for API modes
ChatGPT (API)→OpenAI (API)Claude.ai (API)→Anthropic (API)ChatGPT (Azure API)→Azure OpenAI (API)Update internal function names for consistency with API provider terminology
generateAnswersWithChatgptApi→generateAnswersWithOpenAiApigenerateAnswersWithChatgptApiCompat→generateAnswersWithOpenAiApiCompatAdd missing
Anthropic API Keylocale string across all language filesUpdate locale strings to use
Anthropicinstead ofClaudefor API-related settingsDiagram Walkthrough
File Walkthrough
13 files
Update German locale strings for Anthropic APIUpdate English locale strings for Anthropic APIUpdate Spanish locale strings for Anthropic APIUpdate French locale strings for Anthropic APIUpdate Indonesian locale strings for Anthropic APIUpdate Italian locale strings for Anthropic APIUpdate Japanese locale strings for Anthropic APIUpdate Korean locale strings for Anthropic APIUpdate Portuguese locale strings for Anthropic APIUpdate Russian locale strings for Anthropic APIUpdate Turkish locale strings for Anthropic APIUpdate Simplified Chinese locale strings for Anthropic APIUpdate Traditional Chinese locale strings for Anthropic API11 files
Rename ChatGPT API function to OpenAI APIUpdate model group and model display names for API providersUpdate Custom Anthropic API URL label in UIUpdate Anthropic API Key placeholder textRename OpenAI API compat function callRename OpenAI API compat function callRename OpenAI API compat function callRename OpenAI API compat function callRename OpenAI API compat function callRename ChatGPT API functions to OpenAI APIRename OpenAI API compat function call1 files
Update test names for OpenAI API compat functionSummary by CodeRabbit
New Features
Chores