Skip to content

Add GPT-5.4 mini and nano model support#957

Merged
PeterDaveHello merged 1 commit intoChatGPTBox-dev:masterfrom
PeterDaveHello:add-gpt-5-4-mini-nano
Mar 17, 2026
Merged

Add GPT-5.4 mini and nano model support#957
PeterDaveHello merged 1 commit intoChatGPTBox-dev:masterfrom
PeterDaveHello:add-gpt-5-4-mini-nano

Conversation

@PeterDaveHello
Copy link
Member

@PeterDaveHello PeterDaveHello commented Mar 17, 2026

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:


Open with Devin

Summary by CodeRabbit

Release Notes

  • New Features

    • Added support for two new OpenAI GPT-5.4 model variants: GPT-5.4 mini and GPT-5.4 nano.
    • Extended multilingual localization across 13 languages to support the new models.
  • Tests

    • Added comprehensive test coverage for the new model variants and API compatibility verification.

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
@PeterDaveHello PeterDaveHello requested a review from Copilot March 17, 2026 17:38
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 17, 2026

📝 Walkthrough

Walkthrough

This 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

Cohort / File(s) Summary
Locale Entries
src/_locales/de/main.json, src/_locales/en/main.json, src/_locales/es/main.json, src/_locales/fr/main.json, src/_locales/in/main.json, src/_locales/it/main.json, src/_locales/ja/main.json, src/_locales/ko/main.json, src/_locales/pt/main.json, src/_locales/ru/main.json, src/_locales/tr/main.json, src/_locales/zh-hans/main.json, src/_locales/zh-hant/main.json
Added two new locale keys for GPT-5.4 model variants: "OpenAI (GPT-5.4 mini)" and "OpenAI (GPT-5.4 nano)" across all 13 language files.
Model Configuration
src/config/index.mjs
Registered two new ChatGPT API model keys (chatgptApi5_4Mini and chatgptApi5_4Nano) in both the chatgptApiModelKeys list and Models mapping with corresponding model identifiers (gpt-5.4-mini and gpt-5.4-nano).
Test Coverage
tests/unit/config/config-predicates.test.mjs, tests/unit/services/apis/openai-api-compat.test.mjs, tests/unit/services/apis/openai-token-params.test.mjs, tests/unit/utils/model-name-convert.test.mjs
Extended test fixtures and assertions to cover new model variants, including validation of max_completion_tokens parameter handling for GPT-5.4 mini/nano models and descriptor mappings.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

Review effort 2/5

Suggested reviewers

  • kmk142789

Poem

🐰 Two models hopping in GPT's family tree,
Mini and nano variants, now set free,
Across thirteen tongues they proudly sing,
With tests that verify each token-param thing!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add GPT-5.4 mini and nano model support' directly and specifically describes the main change in the pull request, which is adding support for two new OpenAI model variants across locale files, configuration, and tests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@gemini-code-assist
Copy link

Summary of Changes

Hello, 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 Model Support: Added support for OpenAI's new GPT-5.4 mini and GPT-5.4 nano models across the application.
  • Internationalization Updates: Updated localization files for multiple languages to include the display names for the new GPT-5.4 mini and nano models.
  • API Configuration: Integrated the new GPT-5.4 mini and nano models into the application's API configuration, defining their internal keys and display descriptions.
  • Token Parameter Handling: Ensured correct handling of max_completion_tokens for the new GPT-5.4 mini and nano models, aligning with OpenAI's API specifications.
  • Unit Test Coverage: Expanded unit tests to cover the new model configurations, token parameter handling, and model name conversions, ensuring robust integration.

🧠 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
  • src/_locales/de/main.json
    • Added "OpenAI (GPT-5.4 mini)" and "OpenAI (GPT-5.4 nano)" entries.
  • src/_locales/en/main.json
    • Added "OpenAI (GPT-5.4 mini)" and "OpenAI (GPT-5.4 nano)" entries.
  • src/_locales/es/main.json
    • Added "OpenAI (GPT-5.4 mini)" and "OpenAI (GPT-5.4 nano)" entries.
  • src/_locales/fr/main.json
    • Added "OpenAI (GPT-5.4 mini)" and "OpenAI (GPT-5.4 nano)" entries.
  • src/_locales/in/main.json
    • Added "OpenAI (GPT-5.4 mini)" and "OpenAI (GPT-5.4 nano)" entries.
  • src/_locales/it/main.json
    • Added "OpenAI (GPT-5.4 mini)" and "OpenAI (GPT-5.4 nano)" entries.
  • src/_locales/ja/main.json
    • Added "OpenAI (GPT-5.4 mini)" and "OpenAI (GPT-5.4 nano)" entries.
  • src/_locales/ko/main.json
    • Added "OpenAI (GPT-5.4 mini)" and "OpenAI (GPT-5.4 nano)" entries.
  • src/_locales/pt/main.json
    • Added "OpenAI (GPT-5.4 mini)" and "OpenAI (GPT-5.4 nano)" entries.
  • src/_locales/ru/main.json
    • Added "OpenAI (GPT-5.4 mini)" and "OpenAI (GPT-5.4 nano)" entries.
  • src/_locales/tr/main.json
    • Added "OpenAI (GPT-5.4 mini)" and "OpenAI (GPT-5.4 nano)" entries.
  • src/_locales/zh-hans/main.json
    • Added "OpenAI (GPT-5.4 mini)" and "OpenAI (GPT-5.4 nano)" entries.
  • src/_locales/zh-hant/main.json
    • Added "OpenAI (GPT-5.4 mini)" and "OpenAI (GPT-5.4 nano)" entries.
  • src/config/index.mjs
    • Added 'chatgptApi5_4Mini' and 'chatgptApi5_4Nano' to the 'chatgptApiModelKeys' array.
    • Defined new model objects for 'chatgptApi5_4Mini' and 'chatgptApi5_4Nano' with their respective API values and descriptions in the 'Models' export.
  • tests/unit/config/config-predicates.test.mjs
    • Included 'chatgptApi5_4Mini' and 'chatgptApi5_4Nano' in the 'representativeChatgptApiModelNames' array for testing purposes.
  • tests/unit/services/apis/openai-api-compat.test.mjs
    • Added a new test case to verify that 'max_completion_tokens' is correctly used when generating answers with the GPT-5.4 mini model.
    • Added a new test case to verify that 'max_completion_tokens' is correctly used when generating answers with the GPT-5.4 nano model.
  • tests/unit/services/apis/openai-token-params.test.mjs
    • Extended the list of models that use 'max_completion_tokens' to include 'gpt-5.4-mini' and 'gpt-5.4-nano'.
  • tests/unit/utils/model-name-convert.test.mjs
    • Added assertions to confirm that 'modelNameToDesc' correctly returns the descriptions for 'chatgptApi5_4Mini' and 'chatgptApi5_4Nano'.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

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.

Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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_4Mini and chatgptApi5_4Nano model keys with values gpt-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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 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_mini and chatgptApi5_4_nano to 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 Models object, 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

📥 Commits

Reviewing files that changed from the base of the PR and between a917f1f and 31bc159.

📒 Files selected for processing (18)
  • src/_locales/de/main.json
  • src/_locales/en/main.json
  • src/_locales/es/main.json
  • src/_locales/fr/main.json
  • src/_locales/in/main.json
  • src/_locales/it/main.json
  • src/_locales/ja/main.json
  • src/_locales/ko/main.json
  • src/_locales/pt/main.json
  • src/_locales/ru/main.json
  • src/_locales/tr/main.json
  • src/_locales/zh-hans/main.json
  • src/_locales/zh-hant/main.json
  • src/config/index.mjs
  • tests/unit/config/config-predicates.test.mjs
  • tests/unit/services/apis/openai-api-compat.test.mjs
  • tests/unit/services/apis/openai-token-params.test.mjs
  • tests/unit/utils/model-name-convert.test.mjs

@PeterDaveHello PeterDaveHello merged commit 6aa57ff into ChatGPTBox-dev:master Mar 17, 2026
8 checks passed
@PeterDaveHello PeterDaveHello deleted the add-gpt-5-4-mini-nano branch March 17, 2026 17:48
@qodo-code-review
Copy link
Contributor

Review Summary by Qodo

Add GPT-5.4 mini and nano model support with multilingual localization

✨ Enhancement

Grey Divider

Walkthroughs

Description
• 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
Diagram
flowchart 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"]
Loading

Grey Divider

File Changes

1. src/config/index.mjs ✨ Enhancement +4/-0

Add GPT-5.4 mini and nano model definitions

src/config/index.mjs


2. src/_locales/de/main.json Localization +2/-0

Add German localization for new models

src/_locales/de/main.json


3. src/_locales/en/main.json Localization +2/-0

Add English localization for new models

src/_locales/en/main.json


View more (15)
4. src/_locales/es/main.json Localization +2/-0

Add Spanish localization for new models

src/_locales/es/main.json


5. src/_locales/fr/main.json Localization +2/-0

Add French localization for new models

src/_locales/fr/main.json


6. src/_locales/in/main.json Localization +2/-0

Add Indonesian localization for new models

src/_locales/in/main.json


7. src/_locales/it/main.json Localization +2/-0

Add Italian localization for new models

src/_locales/it/main.json


8. src/_locales/ja/main.json Localization +2/-0

Add Japanese localization for new models

src/_locales/ja/main.json


9. src/_locales/ko/main.json Localization +2/-0

Add Korean localization for new models

src/_locales/ko/main.json


10. src/_locales/pt/main.json Localization +2/-0

Add Portuguese localization for new models

src/_locales/pt/main.json


11. src/_locales/ru/main.json Localization +2/-0

Add Russian localization for new models

src/_locales/ru/main.json


12. src/_locales/tr/main.json Localization +2/-0

Add Turkish localization for new models

src/_locales/tr/main.json


13. src/_locales/zh-hans/main.json Localization +2/-0

Add Simplified Chinese localization for new models

src/_locales/zh-hans/main.json


14. src/_locales/zh-hant/main.json Localization +2/-0

Add Traditional Chinese localization for new models

src/_locales/zh-hant/main.json


15. tests/unit/config/config-predicates.test.mjs 🧪 Tests +2/-0

Add new models to representative test list

tests/unit/config/config-predicates.test.mjs


16. tests/unit/services/apis/openai-api-compat.test.mjs 🧪 Tests +70/-0

Add test cases for GPT-5.4 mini and nano models

tests/unit/services/apis/openai-api-compat.test.mjs


17. tests/unit/services/apis/openai-token-params.test.mjs 🧪 Tests +2/-0

Add token parameter tests for new models

tests/unit/services/apis/openai-token-params.test.mjs


18. tests/unit/utils/model-name-convert.test.mjs 🧪 Tests +2/-0

Add model name conversion tests for new variants

tests/unit/utils/model-name-convert.test.mjs


Grey Divider

Qodo Logo

@qodo-code-review
Copy link
Contributor

qodo-code-review bot commented Mar 17, 2026

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (1) 📎 Requirement gaps (0)

Grey Divider


Remediation recommended

1. sk-test API key literal 📘 Rule violation ⛨ Security
Description
Unit tests hardcode an API-key-like string (sk-test), which can be mistaken for a real secret and
may trigger secret scanners. This violates the requirement to avoid committing API keys/tokens in
the repository.
Code

tests/unit/services/apis/openai-api-compat.test.mjs[238]

+  await generateAnswersWithOpenAiApi(port, 'CurrentQ', session, 'sk-test')
Evidence
PR Compliance ID 1 forbids hardcoded secrets/API keys in tracked files; the changed test code
includes the literal sk-test as an OpenAI API key argument in two new test cases.

AGENTS.md
tests/unit/services/apis/openai-api-compat.test.mjs[238-238]
tests/unit/services/apis/openai-api-compat.test.mjs[273-273]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
New unit tests pass a hardcoded API-key-like string (`sk-test`) into `generateAnswersWithOpenAiApi`, which violates the no-secrets requirement and can trigger secret scanning.

## Issue Context
This is test-only data, but using a realistic key prefix (`sk-`) is still treated as a credential pattern by many scanners.

## Fix Focus Areas
- tests/unit/services/apis/openai-api-compat.test.mjs[238-238]
- tests/unit/services/apis/openai-api-compat.test.mjs[273-273]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

ⓘ The new review experience is currently in Beta. Learn more

Grey Divider

Qodo Logo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants