Skip to content

fix(examples): use async sandbox in browser-use CUA - #237

Open
MagMueller wants to merge 1 commit into
agent-infra:mainfrom
MagMueller:agency/fix-browser-use-cua-async
Open

MagMueller wants to merge 1 commit into
agent-infra:mainfrom
MagMueller:agency/fix-browser-use-cua-async

Conversation

@MagMueller

Copy link
Copy Markdown

Summary

  • use AsyncSandbox for the awaited browser calls in the official Browser Use CUA example
  • resolve CDP inside async main while keeping is_local=True
  • pass the generated left/right/middle button strings directly

Why

Browser Use is the agent in this example. The runtime failures are in the adapter: it awaits and async-iterates methods from the synchronous Sandbox client, and it treats the generated Button string type as an enum with LEFT, RIGHT, and MIDDLE members.

No Browser Use core code changes.

Checks

  • Python 3.12 compile
  • generated SDK probe: get_info and execute_action are coroutines; screenshot is an async generator
  • mocked flow: screenshot bytes, one left click, CDP setup, Browser Use agent run, and cleanup
  • Ruff diagnostics match current main; git diff --check passes
  • exact one-file secret scan: zero findings

PR #181 remains separate duplicate-import, duplicate-Tools, and duplicate-main cleanup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant