Description
`examples/browser-use-cua/main.py` has three duplicated top-level sections:
- Imports — `asyncio`, `base64`, `os`, and `io.BytesIO` are each imported twice in the first 14 lines
- Tools instantiation — `tools = Tools()` appears at both line ~39 and line ~277. The second one overwrites the first binding, so any `@tools.registry.action(...)` decorator attached between them is discarded
- Main block — the file ends with two consecutive `if name == "main": asyncio.run(main())` blocks, so `main()` actually runs twice sequentially
Impact
Only (2) and (3) affect behavior. In the current code the registrations happen after the second `tools = Tools()`, so no action is lost — but the redeclaration pattern is fragile: any future refactor that moves a decorator upward would silently break. (3) causes the demo to run end-to-end twice, which is visible in the console output but easy to miss.
Fix
Collapse imports to one block, remove the second `tools = Tools()`, remove the second `main` block. PR forthcoming.
Description
`examples/browser-use-cua/main.py` has three duplicated top-level sections:
Impact
Only (2) and (3) affect behavior. In the current code the registrations happen after the second `tools = Tools()`, so no action is lost — but the redeclaration pattern is fragile: any future refactor that moves a decorator upward would silently break. (3) causes the demo to run end-to-end twice, which is visible in the console output but easy to miss.
Fix
Collapse imports to one block, remove the second `tools = Tools()`, remove the second `main` block. PR forthcoming.