Add GPT-5.4 mini and nano model support#957
Add GPT-5.4 mini and nano model support#957PeterDaveHello merged 1 commit intoChatGPTBox-dev:masterfrom
Conversation
Expand OpenAI API model registry with GPT-5.4 mini and nano variants. Align token-parameter handling and service tests with new model naming. Reference: - https://openai.com/index/introducing-gpt-5-4-mini-and-nano/ - https://developers.openai.com/api/docs/models/gpt-5.4-mini - https://developers.openai.com/api/docs/models/gpt-5.4-nano
📝 WalkthroughWalkthroughThis PR adds support for two new OpenAI GPT-5.4 model variants (mini and nano) by registering them in the configuration, updating localization strings across 13 language files, and extending test coverage to verify correct token parameter handling. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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 |
Summary of ChangesHello, 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 significantly expands the application's compatibility with OpenAI's latest models by integrating GPT-5.4 mini and nano. The changes ensure that these new models are properly recognized, configured, and function correctly within the existing API framework, including appropriate token parameter management and updated user-facing descriptions across various languages. 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
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
|
There was a problem hiding this comment.
Code Review
This pull request successfully adds support for the new GPT-5.4 mini and nano models across the application, including configuration, localization, and testing. The changes are consistent and correct. I've included one suggestion to refactor the new tests in tests/unit/services/apis/openai-api-compat.test.mjs to reduce code duplication and improve maintainability.
There was a problem hiding this comment.
Pull request overview
Expands the OpenAI model registry to include GPT-5.4 mini/nano variants and updates unit tests to ensure these models map to the correct API model IDs and token-limit parameter behavior.
Changes:
- Register
chatgptApi5_4MiniandchatgptApi5_4Nanomodel keys with valuesgpt-5.4-mini/gpt-5.4-nano. - Extend unit tests to validate model name → description conversion and OpenAI token parameter selection (
max_completion_tokens). - Add i18n strings for the new model descriptions across supported locales.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/unit/utils/model-name-convert.test.mjs | Adds assertions for GPT-5.4 mini/nano descriptions. |
| tests/unit/services/apis/openai-token-params.test.mjs | Ensures GPT-5.4 mini/nano use max_completion_tokens. |
| tests/unit/services/apis/openai-api-compat.test.mjs | Verifies request bodies for mini/nano include correct model ID and token param field. |
| tests/unit/config/config-predicates.test.mjs | Includes new model keys in representative ChatGPT API model list. |
| src/config/index.mjs | Registers the new model keys and values in chatgptApiModelKeys / Models. |
| src/_locales/*/main.json | Adds localized strings for the new model descriptions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/config/index.mjs (1)
61-62: Consider aligning naming convention with GPT-4.1 variants.The new model keys use PascalCase suffixes (
chatgptApi5_4Mini,chatgptApi5_4Nano), while the existing GPT-4.1 variants at lines 71-72 use lowercase (chatgptApi4_1_mini,chatgptApi4_1_nano). This inconsistency may cause confusion when developers look for similar patterns.If backward compatibility isn't a concern, consider using
chatgptApi5_4_miniandchatgptApi5_4_nanoto match the existing convention.♻️ Proposed fix for naming consistency
'chatgptApi5_4', - 'chatgptApi5_4Mini', - 'chatgptApi5_4Nano', + 'chatgptApi5_4_mini', + 'chatgptApi5_4_nano', 'chatgptApi4oMini',Note: This would require updating the corresponding entries in the
Modelsobject, locale files, and tests as well.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/config/index.mjs` around lines 61 - 62, The new model keys chatgptApi5_4Mini and chatgptApi5_4Nano use PascalCase suffixes that are inconsistent with the existing GPT-4.1 keys (chatgptApi4_1_mini, chatgptApi4_1_nano); rename these keys to chatgptApi5_4_mini and chatgptApi5_4_nano to match the lowercase_underscore convention, then update all corresponding references in the Models object, locale strings, tests, and any codepaths that import or switch on these keys to prevent runtime mismatches.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/config/index.mjs`:
- Around line 61-62: The new model keys chatgptApi5_4Mini and chatgptApi5_4Nano
use PascalCase suffixes that are inconsistent with the existing GPT-4.1 keys
(chatgptApi4_1_mini, chatgptApi4_1_nano); rename these keys to
chatgptApi5_4_mini and chatgptApi5_4_nano to match the lowercase_underscore
convention, then update all corresponding references in the Models object,
locale strings, tests, and any codepaths that import or switch on these keys to
prevent runtime mismatches.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: a7b234e2-3576-48f6-b46a-0d28f969fa88
📒 Files selected for processing (18)
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/config/index.mjstests/unit/config/config-predicates.test.mjstests/unit/services/apis/openai-api-compat.test.mjstests/unit/services/apis/openai-token-params.test.mjstests/unit/utils/model-name-convert.test.mjs
Review Summary by QodoAdd GPT-5.4 mini and nano model support with multilingual localization
WalkthroughsDescription• Add GPT-5.4 mini and nano model support to OpenAI API registry • Extend multilingual localization across 13 languages for new models • Add comprehensive test coverage for new model variants • Align token-parameter handling with max_completion_tokens for new models Diagramflowchart LR
A["Model Registry"] -->|Add mini/nano variants| B["Config Index"]
B -->|Define model values| C["Models Object"]
C -->|Map to API calls| D["OpenAI API"]
E["Localization Files"] -->|13 languages| F["UI Display"]
G["Token Parameters"] -->|max_completion_tokens| D
H["Test Coverage"] -->|Validate models| I["API Compatibility"]
File Changes1. src/config/index.mjs
|
Code Review by Qodo
1. sk-test API key literal
|
Expand OpenAI API model registry with GPT-5.4 mini and nano variants. Align token-parameter handling and service tests with new model naming.
Reference:
Summary by CodeRabbit
Release Notes
New Features
Tests