[Claimed #1844] Refactor model ID checks for GPT 5.x model family
Mirrored from external contributor PR #1844 after approval by @miguelg719.
Original author: @praveentcom
Original PR: https://github.com/browserbase/stagehand/pull/1844
Approved source head SHA: a637dc329bfc5426bb71c8551c812191ed631527
@praveentcom, please continue any follow-up discussion on this mirrored PR. When the external PR gets new commits, this same internal PR will be marked stale until the latest external commit is approved and refreshed here.
Original description
All GPT-5.x series models don't support minimal as the reasoningEffort. Currently, it is enabled only for GPT-5.1 and GPT-5.2 models to set the reasoningEffort as low. 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
Default reasoningEffort to "none" for all gpt-5.* models (excluding codex) to avoid unsupported "minimal" errors, with an override via ClientOptions.reasoningEffort, and default GPT-5 textVerbosity set to "low".
Also plumbs clientOptions into both AISdkClient and AISdkClientWrapped and applies the same reasoning/text-verbosity behavior (codex stays "medium").