-
Notifications
You must be signed in to change notification settings - Fork 8.2k
highlight in parallel #2873
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
highlight in parallel #2873
Conversation
Agent Task Evaluation Results: 0/3 (0%)View detailed results
Check the evaluate-tasks job for detailed task execution logs. |
|
||
# Execute all element processing tasks in parallel | ||
if tasks: | ||
await asyncio.gather(*tasks, return_exceptions=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Async Highlighting Fails Due to ImageDraw Thread Safety
The create_highlighted_screenshot
function attempts parallel highlighting with asyncio.gather
, but process_element_highlight
is synchronous, adding overhead without performance gain. Multiple tasks concurrently modify the shared PIL ImageDraw
object, which is not thread-safe and can corrupt the screenshot's highlights.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 issue found across 3 files
React with 👍 or 👎 to teach cubic. You can also tag @cubic-dev-ai
to give feedback, ask questions, or re-run the review.
import time | ||
from typing import TYPE_CHECKING | ||
|
||
from utils import time_execution_async |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect import path causes runtime ImportError; utils is not a top-level module in this package. Use the package-qualified import instead.
(Based on your team's feedback about matching the project's tab-based indentation style, the one-line fix follows your formatting conventions.)
Prompt for AI agents
Address the following comment on browser_use/browser/watchdogs/dom_watchdog.py at line 7:
<comment>Incorrect import path causes runtime ImportError; utils is not a top-level module in this package. Use the package-qualified import instead.
(Based on your team's feedback about matching the project's tab-based indentation style, the one-line fix follows your formatting conventions.)</comment>
<file context>
@@ -4,6 +4,8 @@
import time
from typing import TYPE_CHECKING
+from utils import time_execution_async
+
from browser_use.browser.events import (
</file context>
from utils import time_execution_async | |
from browser_use.utils import time_execution_async |
Auto-generated PR for: highlight in parallel
Summary by cubic
Render element highlights in parallel and add timing to key paths to speed up screenshot annotation. This makes highlighting faster on pages with many elements.