Skip to content

fix(provider): wrap default OpenAI screenshot selector - #170

Merged
sarath-menon merged 2 commits into
mainfrom
screenshot-default-wrap
Oct 2, 2026
Merged

sarath-menon merged 2 commits into
mainfrom
screenshot-default-wrap

Conversation

@sarath-menon

@sarath-menon sarath-menon commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

Issue for this PR

Completes #169 after staging showed that OpenAI still sent inline screenshots.

Type of change

  • Bug fix

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 existing responses() 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.getLanguage regression 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-sol and direct Anthropic claude-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

  • I have tested my changes locally and in shared staging
  • I have not included unrelated changes in this PR

@sarath-menon
sarath-menon marked this pull request as ready for review October 2, 2026 05:37

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 2 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread packages/opencode/test/provider/provider.test.ts Outdated
@sarath-menon
sarath-menon merged commit 20bed21 into main Oct 2, 2026
3 checks passed
@sarath-menon sarath-menon added the tested-in-staging Verified in shared staging with recorded evidence label Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tested-in-staging Verified in shared staging with recorded evidence

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant