feat(provider): upload screenshots once before gateway serialization - #169
Merged
Merged
Conversation
added 3 commits
October 1, 2026 08:00
Externalize Cloud Responses images before gateway JSON serialization, preserving tool history with bounded run caches, expiry recovery, ownership proofs and disposal cleanup.
3 tasks done
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.
Upload repeated screenshots once before agent requests reach the Cloud gateway, then reuse run/account-scoped provider file references. Bound the cache and uploads, preserve conversation history and beta flags, and delete files during disposal. This supports verified direct OpenAI Responses and direct Anthropic routes; Bedrock and other unsupported routes keep their existing behavior. BrowserCode #170 is required to cover the configuration-only OpenAI default selector discovered in shared staging.
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 original
screenshot-files.1binary passed direct Anthropic but failed OpenAI's file-reference assertion. The final checks above usescreenshot-files.2, including #170, pinned by browser-use/cloud#6269 with gateway browser-use/cloud#6266. The label covers that corrected combined deployment. No production deployment was performed.