add gpt 5 handling to operator handler - #1046
Conversation
🦋 Changeset detectedLatest commit: 7c89ab2 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Greptile Summary
This PR adds GPT-5 specific temperature handling to the operatorHandler.ts file to maintain consistency with existing patterns in the codebase. The change detects when a model name contains 'gpt-5' and sets the temperature to 1.0, while keeping the existing temperature of 0.1 for all other models.
This modification aligns the operator handler with the established pattern already implemented in inference.ts, where GPT-5 models use a higher temperature setting (1.0) compared to other models (0.1). The change ensures that all inference calls across the codebase handle GPT-5 models consistently, addressing a gap where the operator handler was missing this model-specific configuration.
The implementation follows the exact same pattern used elsewhere: checking if the model name includes 'gpt-5' and conditionally setting the temperature parameter in the chat completion options. This creates uniformity in how GPT-5 models are configured across extract, observe, and operator functions.
Confidence score: 5/5
- This PR is safe to merge with minimal risk as it's a simple configuration change following an established pattern
- Score reflects the straightforward nature of the change and consistency with existing codebase patterns
- No files require special attention as the change is isolated and follows existing conventions
1 file reviewed, no comments
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @browserbasehq/stagehand@2.5.0 ### Minor Changes - [#981](#981) [`8244ab2`](8244ab2) Thanks [@sameelarif](https://github.com/sameelarif)! - Added support for `stagehand.agent` to interact with MCP servers as well as custom tools to be passed in. For more information, reference the [MCP integrations documentation](https://docs.stagehand.dev/best-practices/mcp-integrations) ### Patch Changes - [#959](#959) [`09b5e1e`](09b5e1e) Thanks [@filip-michalsky](https://github.com/filip-michalsky)! - add webvoyager evals - [#1049](#1049) [`e3734b9`](e3734b9) Thanks [@miguelg719](https://github.com/miguelg719)! - Support local MCP server connections - [#1025](#1025) [`be85b19`](be85b19) Thanks [@tkattkat](https://github.com/tkattkat)! - add support for custom baseUrl within openai provider - [#1040](#1040) [`88d1565`](88d1565) Thanks [@miguelg719](https://github.com/miguelg719)! - Allow OpenAI CUA to take in an optional baseURL - [#1046](#1046) [`ab5d6ed`](ab5d6ed) Thanks [@tkattkat](https://github.com/tkattkat)! - Add support for gpt-5 in operator agent ## @browserbasehq/stagehand-evals@1.0.9 ### Patch Changes - Updated dependencies \[[`09b5e1e`](09b5e1e), [`e3734b9`](e3734b9), [`8244ab2`](8244ab2), [`be85b19`](be85b19), [`88d1565`](88d1565), [`ab5d6ed`](ab5d6ed)]: - @browserbasehq/stagehand@2.5.0 ## @browserbasehq/stagehand-examples@1.0.9 ### Patch Changes - Updated dependencies \[[`09b5e1e`](09b5e1e), [`e3734b9`](e3734b9), [`8244ab2`](8244ab2), [`be85b19`](be85b19), [`88d1565`](88d1565), [`ab5d6ed`](ab5d6ed)]: - @browserbasehq/stagehand@2.5.0 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @browserbasehq/stagehand@2.5.0 ### Minor Changes - [#981](browserbase/stagehand#981) [`8244ab2`](browserbase/stagehand@8244ab2) Thanks [@sameelarif](https://github.com/sameelarif)! - Added support for `stagehand.agent` to interact with MCP servers as well as custom tools to be passed in. For more information, reference the [MCP integrations documentation](https://docs.stagehand.dev/best-practices/mcp-integrations) ### Patch Changes - [#959](browserbase/stagehand#959) [`09b5e1e`](browserbase/stagehand@09b5e1e) Thanks [@filip-michalsky](https://github.com/filip-michalsky)! - add webvoyager evals - [#1049](browserbase/stagehand#1049) [`e3734b9`](browserbase/stagehand@e3734b9) Thanks [@miguelg719](https://github.com/miguelg719)! - Support local MCP server connections - [#1025](browserbase/stagehand#1025) [`be85b19`](browserbase/stagehand@be85b19) Thanks [@tkattkat](https://github.com/tkattkat)! - add support for custom baseUrl within openai provider - [#1040](browserbase/stagehand#1040) [`88d1565`](browserbase/stagehand@88d1565) Thanks [@miguelg719](https://github.com/miguelg719)! - Allow OpenAI CUA to take in an optional baseURL - [#1046](browserbase/stagehand#1046) [`ab5d6ed`](browserbase/stagehand@ab5d6ed) Thanks [@tkattkat](https://github.com/tkattkat)! - Add support for gpt-5 in operator agent ## @browserbasehq/stagehand-evals@1.0.9 ### Patch Changes - Updated dependencies \[[`09b5e1e`](browserbase/stagehand@09b5e1e), [`e3734b9`](browserbase/stagehand@e3734b9), [`8244ab2`](browserbase/stagehand@8244ab2), [`be85b19`](browserbase/stagehand@be85b19), [`88d1565`](browserbase/stagehand@88d1565), [`ab5d6ed`](browserbase/stagehand@ab5d6ed)]: - @browserbasehq/stagehand@2.5.0 ## @browserbasehq/stagehand-examples@1.0.9 ### Patch Changes - Updated dependencies \[[`09b5e1e`](browserbase/stagehand@09b5e1e), [`e3734b9`](browserbase/stagehand@e3734b9), [`8244ab2`](browserbase/stagehand@8244ab2), [`be85b19`](browserbase/stagehand@be85b19), [`88d1565`](browserbase/stagehand@88d1565), [`ab5d6ed`](browserbase/stagehand@ab5d6ed)]: - @browserbasehq/stagehand@2.5.0 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
# why when using operator handler with gpt-5, the temperature is not being set to 1 # what changed the temperature now gets set to 1 when gpt-5 is being used # test plan
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @browserbasehq/stagehand@2.5.0 ### Minor Changes - [browserbase#981](browserbase#981) [`8244ab2`](browserbase@8244ab2) Thanks [@sameelarif](https://github.com/sameelarif)! - Added support for `stagehand.agent` to interact with MCP servers as well as custom tools to be passed in. For more information, reference the [MCP integrations documentation](https://docs.stagehand.dev/best-practices/mcp-integrations) ### Patch Changes - [browserbase#959](browserbase#959) [`09b5e1e`](browserbase@09b5e1e) Thanks [@filip-michalsky](https://github.com/filip-michalsky)! - add webvoyager evals - [browserbase#1049](browserbase#1049) [`e3734b9`](browserbase@e3734b9) Thanks [@miguelg719](https://github.com/miguelg719)! - Support local MCP server connections - [browserbase#1025](browserbase#1025) [`be85b19`](browserbase@be85b19) Thanks [@tkattkat](https://github.com/tkattkat)! - add support for custom baseUrl within openai provider - [browserbase#1040](browserbase#1040) [`88d1565`](browserbase@88d1565) Thanks [@miguelg719](https://github.com/miguelg719)! - Allow OpenAI CUA to take in an optional baseURL - [browserbase#1046](browserbase#1046) [`ab5d6ed`](browserbase@ab5d6ed) Thanks [@tkattkat](https://github.com/tkattkat)! - Add support for gpt-5 in operator agent ## @browserbasehq/stagehand-evals@1.0.9 ### Patch Changes - Updated dependencies \[[`09b5e1e`](browserbase@09b5e1e), [`e3734b9`](browserbase@e3734b9), [`8244ab2`](browserbase@8244ab2), [`be85b19`](browserbase@be85b19), [`88d1565`](browserbase@88d1565), [`ab5d6ed`](browserbase@ab5d6ed)]: - @browserbasehq/stagehand@2.5.0 ## @browserbasehq/stagehand-examples@1.0.9 ### Patch Changes - Updated dependencies \[[`09b5e1e`](browserbase@09b5e1e), [`e3734b9`](browserbase@e3734b9), [`8244ab2`](browserbase@8244ab2), [`be85b19`](browserbase@be85b19), [`88d1565`](browserbase@88d1565), [`ab5d6ed`](browserbase@ab5d6ed)]: - @browserbasehq/stagehand@2.5.0
why
when using operator handler with gpt-5, the temperature is not being set to 1
what changed
the temperature now gets set to 1 when gpt-5 is being used
test plan