Refactor model ID checks for GPT 5.x model family#1844
Refactor model ID checks for GPT 5.x model family#1844praveentcom wants to merge 2 commits intobrowserbase:mainfrom
Conversation
|
|
This PR is from an external contributor and must be approved by a stagehand team member with write access before CI can run. |
Greptile SummaryThis PR refactors the Key changes:
Issues found:
Confidence Score: 3/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[LLM Request with GPT-5 model] --> B{isGPT5?\nincludes 'gpt-5'}
B -- No --> C[providerOptions: undefined]
B -- Yes --> D{isCodex?\nincludes 'codex'}
D -- Yes --> E[textVerbosity: 'medium'\nreasoningEffort: 'medium']
D -- No --> F{usesLowReasoningEffort?\nincludes 'gpt-5.' AND not codex}
F -- Yes\ngpt-5.1, gpt-5.4, etc. --> G[textVerbosity: 'low'\nreasoningEffort: 'low']
F -- No\ne.g. bare 'gpt-5' --> H[textVerbosity: 'low'\nreasoningEffort: 'minimal' ⚠️]
H --> I[API Error: 'minimal' not supported]
Last reviewed commit: "Fix condition for GP..." |
There was a problem hiding this comment.
No issues found across 1 file
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Since this is your first cubic review, here's how it works:
- cubic automatically reviews your code and comments on bugs and improvements
- Teach cubic by replying to its comments. cubic learns from your replies and gets better over time
- Add one-off context when rerunning by tagging
@cubic-dev-aiwith guidance or docs links (includingllms.txt) - Ask questions if you need clarification on any suggestion
|
@greptile review |
|
This PR was approved by @miguelg719 and mirrored to #1852. All further discussion should happen on that PR. |
All GPT-5.x series models don't support
minimalas thereasoningEffort. Currently, it is enabled only for GPT-5.1 and GPT-5.2 models to set the reasoningEffort aslow. This would start throwing errors like these.Unsupported value: 'minimal' is not supported with the 'gpt-5.4' model. Supported values are: 'none', 'low', 'medium', 'high', and 'xhigh'.This PR fixes the behavior to set the reasoning effort as low for all GPT-5.x series models so that we don't need to manually patch it every time when a new SOTA model is released.
Summary by cubic
Set reasoningEffort to "low" for all GPT-5.x models to prevent unsupported "minimal" errors on new releases like
gpt-5.4. Use a precisegpt-5.match (not version-specific) and keepcodexexcluded, removing the need for manual patches.Written for commit a637dc3. Summary will update on new commits. Review in cubic