Add GPT-5 ~ GPT-5.4 stable models#948
Conversation
Add built-in ChatGPT API presets for gpt-5, gpt-5.1, gpt-5.2, and gpt-5.4 alongside the existing chat-latest entries.
Review Summary by QodoAdd GPT-5 stable model presets (5, 5.1, 5.2, 5.4)
WalkthroughsDescription• Add GPT-5, GPT-5.1, GPT-5.2, GPT-5.4 stable model presets • Register new models in configuration and model keys array • Add unit tests for new GPT-5 stable model detection • Add unit tests for GPT-5 stable model name descriptions Diagramflowchart LR
A["Config Index"] -->|"Add 4 new model entries"| B["Models Object"]
A -->|"Register in model keys"| C["chatgptApiModelKeys Array"]
B -->|"Enable detection"| D["Config Predicates Tests"]
B -->|"Enable descriptions"| E["Model Name Convert Tests"]
File Changes1. src/config/index.mjs
|
Code Review by Qodo
1. GPT-5.3 stable missing
|
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 enhances the application's model configuration by integrating new stable versions of the GPT-5 series, specifically GPT-5, GPT-5.1, GPT-5.2, and GPT-5.4. This update provides users with more granular control and access to specific model iterations, ensuring the system accurately recognizes and describes these new AI capabilities. The changes are supported by corresponding unit tests to maintain code integrity and functionality. 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
|
📝 WalkthroughWalkthroughThis PR extends the ChatGPT API model configuration by introducing four new GPT-5 variant models (gpt-5, gpt-5.1, gpt-5.2, gpt-5.4) alongside corresponding model definitions and test assertions to validate the additions. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 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)
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 |
There was a problem hiding this comment.
Code Review
This pull request adds support for several stable GPT-5 models, including gpt-5, gpt-5.1, gpt-5.2, and gpt-5.4, along with corresponding tests. The changes are generally good, but I've identified a few areas for improvement. There are some inconsistencies in the model definitions where gpt-5.3 is skipped and gpt-5.4 is added without its ...latest counterpart. I've also suggested refactoring the new tests to be more data-driven, which will improve their maintainability.
| chatgptApi5_2Latest: { value: 'gpt-5.2-chat-latest', desc: 'ChatGPT (ChatGPT-5.2 latest)' }, | ||
| chatgptApi5_2: { value: 'gpt-5.2', desc: 'ChatGPT (GPT-5.2)' }, | ||
| chatgptApi5_3Latest: { value: 'gpt-5.3-chat-latest', desc: 'ChatGPT (ChatGPT-5.3 latest)' }, | ||
| chatgptApi5_4: { value: 'gpt-5.4', desc: 'ChatGPT (GPT-5.4)' }, |
| assert.equal(isUsingChatgptApiModel({ modelName: 'chatgptApi4oMini' }), true) | ||
| assert.equal(isUsingChatgptApiModel({ modelName: 'chatgptApi5' }), true) | ||
| assert.equal(isUsingChatgptApiModel({ modelName: 'chatgptApi5_1' }), true) | ||
| assert.equal(isUsingChatgptApiModel({ modelName: 'chatgptApi5_2' }), true) | ||
| assert.equal(isUsingChatgptApiModel({ modelName: 'chatgptApi5_4' }), true) |
There was a problem hiding this comment.
To improve readability and make it easier to add more models in the future, you could refactor these repeated assertions into a loop. This avoids repeating assert.equal for each model and makes the test more maintainable.
| assert.equal(isUsingChatgptApiModel({ modelName: 'chatgptApi4oMini' }), true) | |
| assert.equal(isUsingChatgptApiModel({ modelName: 'chatgptApi5' }), true) | |
| assert.equal(isUsingChatgptApiModel({ modelName: 'chatgptApi5_1' }), true) | |
| assert.equal(isUsingChatgptApiModel({ modelName: 'chatgptApi5_2' }), true) | |
| assert.equal(isUsingChatgptApiModel({ modelName: 'chatgptApi5_4' }), true) | |
| const modelsToTest = ['chatgptApi4oMini', 'chatgptApi5', 'chatgptApi5_1', 'chatgptApi5_2', 'chatgptApi5_4']; | |
| for (const modelName of modelsToTest) { | |
| assert.equal(isUsingChatgptApiModel({ modelName }), true, `Model ${modelName} should be detected as a ChatGPT API model.`); | |
| } |
| test('modelNameToDesc returns desc for GPT-5 stable presets', () => { | ||
| assert.equal(modelNameToDesc('chatgptApi5'), 'ChatGPT (GPT-5)') | ||
| assert.equal(modelNameToDesc('chatgptApi5_1'), 'ChatGPT (GPT-5.1)') | ||
| assert.equal(modelNameToDesc('chatgptApi5_2'), 'ChatGPT (GPT-5.2)') | ||
| assert.equal(modelNameToDesc('chatgptApi5_4'), 'ChatGPT (GPT-5.4)') | ||
| }) |
There was a problem hiding this comment.
This is a good test case. To make it more concise and easier to extend with more models in the future, consider using a data-driven approach. You can iterate over a map of model names to their expected descriptions.
| test('modelNameToDesc returns desc for GPT-5 stable presets', () => { | |
| assert.equal(modelNameToDesc('chatgptApi5'), 'ChatGPT (GPT-5)') | |
| assert.equal(modelNameToDesc('chatgptApi5_1'), 'ChatGPT (GPT-5.1)') | |
| assert.equal(modelNameToDesc('chatgptApi5_2'), 'ChatGPT (GPT-5.2)') | |
| assert.equal(modelNameToDesc('chatgptApi5_4'), 'ChatGPT (GPT-5.4)') | |
| }) | |
| test('modelNameToDesc returns desc for GPT-5 stable presets', () => { | |
| const models = { | |
| chatgptApi5: 'ChatGPT (GPT-5)', | |
| chatgptApi5_1: 'ChatGPT (GPT-5.1)', | |
| chatgptApi5_2: 'ChatGPT (GPT-5.2)', | |
| chatgptApi5_4: 'ChatGPT (GPT-5.4)', | |
| }; | |
| for (const [modelName, expectedDesc] of Object.entries(models)) { | |
| assert.equal(modelNameToDesc(modelName), expectedDesc, `Description for ${modelName} is incorrect.`); | |
| } | |
| }) |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/config/index.mjs`:
- Around line 59-60: Add the missing stable GPT‑5.3 model entry to the Models
object and include its key in chatgptApiModelKeys: insert a new Models entry
with key chatgptApi5_3 and value { value: 'gpt-5.3', desc: 'ChatGPT (GPT-5.3)' }
and add 'chatgptApi5_3' into the chatgptApiModelKeys array immediately after
'chatgptApi5_2' and before 'chatgptApi5_3Latest' so the stable and -Latest
variants are paired.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 9ada50ea-d3c0-44c2-b9d8-f8a636753d71
📒 Files selected for processing (3)
src/config/index.mjstests/unit/config/config-predicates.test.mjstests/unit/utils/model-name-convert.test.mjs
| 'chatgptApi5_3Latest', | ||
| 'chatgptApi5_4', |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# First, let's examine the src/config/index.mjs file to see the models around lines 59-60
cd /repo && head -n 270 src/config/index.mjs | tail -n +50 | head -n 70Repository: ChatGPTBox-dev/chatGPTBox
Length of output: 124
🌐 Web query:
OpenAI GPT-5 model versions available stable release 2026
💡 Result:
As of March 5, 2026, the stable GPT‑5 family model versions you can use are:
OpenAI API (developer model IDs)
gpt-5.4andgpt-5.4-pro(released March 5, 2026) [1]gpt-5.2andgpt-5.2-pro(still listed as API models/pricing) [1]gpt-5.3-chat-latest(GPT‑5.3 Instant in the API) [2]
ChatGPT (end-user model names)
- GPT‑5.3 Instant (released March 3, 2026) [2]
- GPT‑5.4 Thinking and GPT‑5.4 Pro (rolled out starting March 5, 2026) [1]
- GPT‑5.2 is the default model for new messages since February 13, 2026 (and older “GPT‑5 Instant/Thinking” were retired from ChatGPT on that date). [3]
Sources: [1] [2] [3]
🏁 Script executed:
git ls-files src/config/index.mjsRepository: ChatGPTBox-dev/chatGPTBox
Length of output: 89
🏁 Script executed:
# Get the actual content of the file around the flagged lines
head -n 270 src/config/index.mjs | tail -n +50Repository: ChatGPTBox-dev/chatGPTBox
Length of output: 6640
Add missing chatgptApi5_3 model entry.
GPT-5.3 Instant was released on March 3, 2026 and is available via the API. The code includes chatgptApi5_3Latest mapping to 'gpt-5.3-chat-latest' but lacks the corresponding stable chatgptApi5_3 entry, breaking the established pattern where each -Latest variant has a paired stable version.
Add chatgptApi5_3: { value: 'gpt-5.3', desc: 'ChatGPT (GPT-5.3)' } to the Models object and 'chatgptApi5_3' to the chatgptApiModelKeys array (between 'chatgptApi5_2' and 'chatgptApi5_3Latest').
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/config/index.mjs` around lines 59 - 60, Add the missing stable GPT‑5.3
model entry to the Models object and include its key in chatgptApiModelKeys:
insert a new Models entry with key chatgptApi5_3 and value { value: 'gpt-5.3',
desc: 'ChatGPT (GPT-5.3)' } and add 'chatgptApi5_3' into the chatgptApiModelKeys
array immediately after 'chatgptApi5_2' and before 'chatgptApi5_3Latest' so the
stable and -Latest variants are paired.
There was a problem hiding this comment.
Question:
Not true.
Answer:
To reduce “confident but wrong” claims like this in /improve (e.g., asserting a model/version exists or that something is “missing”), add stricter instructions that force the agent to:
- verify against the repo code only (no web lookups),
- cite the exact evidence (existing keys/arrays) before proposing a change,
- use uncertainty language when it can’t prove the claim from the diff.
Add to your .pr_agent.toml (or Wiki .pr_agent.toml) something like:
[pr_code_suggestions]
extra_instructions = """\
- Do not use web queries or external knowledge (release dates/model availability). Base findings only on the PR diff and repository files provided.
- Before claiming something is missing/incorrect, quote the exact existing pattern from the code (relevant keys/arrays/sections) and explain why it violates that pattern.
- If the evidence is insufficient, do not propose a fix; ask a clarifying question or label it as a hypothesis (e.g., "might be missing").
- Avoid absolute language ("Not true", "breaking") unless you can point to a concrete reference in the code showing the failure.
"""If this is happening under /review rather than /improve, apply the same idea under [pr_reviewer].extra_instructions.
Relevant Sources:
- https://docs.qodo.ai/qodo-documentation/code-review/qodo-merge/tools/improve#extra-instructions-and-best-practices
- https://docs.qodo.ai/qodo-documentation/code-review/qodo-merge/usage-guide/additional_configurations#extra-instructions
- https://docs.qodo.ai/qodo-documentation/code-review/qodo-merge/tools/review#extra-instructions
- https://docs.qodo.ai/qodo-documentation/code-review/qodo-merge/usage-guide/configuration_options#local-configuration-file
There was a problem hiding this comment.
Skipped: comment is from another GitHub bot.
There was a problem hiding this comment.
@PeterDaveHello, you're right, I apologize for the incorrect suggestion. Looking at the OpenAI documentation, GPT‑5.3 Instant is available to developers in the API as gpt-5.3-chat-latest — there is no published stable gpt-5.3 API model ID. GPT-5.4 replaces the previous gpt-5.2 model in the API, meaning GPT-5.3 was never given a standalone stable alias like the other versions. The existing chatgptApi5_3Latest entry mapping to gpt-5.3-chat-latest is the correct and complete representation. My comment was wrong.
Add built-in ChatGPT API presets for gpt-5, gpt-5.1, gpt-5.2, and gpt-5.4 alongside the existing chat-latest entries.
Summary by CodeRabbit
New Features
Tests