fix(provider): wrap default OpenAI screenshot selector - #170
Merged
Merged
Conversation
sarath-menon
marked this pull request as ready for review
October 2, 2026 05:37
There was a problem hiding this comment.
All reported issues were addressed across 2 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue for this PR
Completes #169 after staging showed that OpenAI still sent inline screenshots.
Type of change
What does this PR do?
Workers configure OpenAI with a run token and no provider key in the agent environment. That path selects
languageModel(), bypassing the existingresponses()wrapper. Wrap the default selector too, preserving the route, account isolation, cache, and cleanup.How did you verify your code works?
The unchanged actual
Provider.getLanguageregression fails on old code and passes with one upload, three file-reference requests without base64, preserved detail, and one deletion. All 22 image-reference tests and the package typecheck pass; Cubic review is clear.How we tested in staging
We deployed the gateway first, then the released BrowserCode worker through the normal staging workflow; read-only AWS checks confirmed the matching image and READY runtime. The full existing API suite passed all 61 checks.
Two owned browser tasks used direct OpenAI
gpt-6.1-soland direct Anthropicclaude-fable-5. Each took one screenshot, made three separate text-only tool turns, and returned the expected earlier image details. Each had four later model requests with one file reference and zero inline images. Datadog lifecycle logs record one upload and one successful deletion per task; test sessions, browsers, and workspaces were cleaned up.OpenAI run:
eab3ef01-5d4d-4245-9949-63699149fc82. Anthropic run:b57f33c0-8f24-4fa4-8daf-7246c2c6d302. These are shared-staging results, not production savings.The released binary is
0.1.21-screenshot-files.2, deployed by browser-use/cloud#6269. No production deployment was performed.Checklist