feat: added browser-use custom CDP domain + version bump#5
Conversation
…ion + updated specification
|
@cubic-dev-ai review this |
@reformedot I've started the AI code review. It'll take a few minutes to complete. |
There was a problem hiding this comment.
1 issue found across 279 files (reviewed changes from recent commits).
Note: This PR contains a large number of files. cubic only reviews up to 150 files per PR, so some files may not have been reviewed.
Prompt for AI agents (all 1 issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="cdp_use/cdp/accessibility/types.py">
<violation number="1" location="cdp_use/cdp/accessibility/types.py:182">
Fix the typo in the AXPropertyName docstring so it reads "node" instead of "noode" to keep the generated documentation accurate.</violation>
</file>
Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR
There was a problem hiding this comment.
2 issues found across 286 files
Note: This PR contains a large number of files. cubic only reviews up to 150 files per PR, so some files may not have been reviewed.
Prompt for AI agents (all 2 issues)
Check if these issues are valid — if so, understand the root cause of each and fix them.
<file name="Taskfile.yml">
<violation number="1" location="Taskfile.yml:33">
format-json fails when no custom protocol files exist because the unmatched glob is treated as a literal path. Add a guard so the loop skips/terminates when no files match.</violation>
</file>
<file name="cdp_use/cdp/accessibility/types.py">
<violation number="1" location="cdp_use/cdp/accessibility/types.py:182">
The new docstring line describing hidden-node reasons contains a typo (“noode” instead of “node”), which should be corrected for clarity.</violation>
</file>
Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR
| desc: "Format JSON protocol files" | ||
| cmds: | ||
| - | | ||
| for file in cdp_use/custom_protocols/*.json; do |
There was a problem hiding this comment.
format-json fails when no custom protocol files exist because the unmatched glob is treated as a literal path. Add a guard so the loop skips/terminates when no files match.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At Taskfile.yml, line 33:
<comment>format-json fails when no custom protocol files exist because the unmatched glob is treated as a literal path. Add a guard so the loop skips/terminates when no files match.</comment>
<file context>
@@ -0,0 +1,46 @@
+ desc: "Format JSON protocol files"
+ cmds:
+ - |
+ for file in cdp_use/custom_protocols/*.json; do
+ python3 -m json.tool "$file" "$file.tmp" && mv "$file.tmp" "$file"
+ done
</file context>
✅ Addressed in b3ee5c0
There was a problem hiding this comment.
6 issues found across 255 files (changes from recent commits).
Note: This PR contains a large number of files. cubic only reviews up to 75 files per PR, so some files may not have been reviewed.
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="cdp_use/cdp/dom/commands.py">
<violation number="1" location="cdp_use/cdp/dom/commands.py:243">
P3: Fix the typo in the docstring (“attibutes” → “attributes”) to keep documentation accurate.</violation>
</file>
<file name="cdp_use/cdp/dom/events.py">
<violation number="1" location="cdp_use/cdp/dom/events.py:151">
P3: Fix the misspelling in the distributed nodes comment.</violation>
</file>
<file name="cdp_use/cdp/css/events.py">
<violation number="1" location="cdp_use/cdp/css/events.py:25">
P2: FontsUpdatedEvent is now an empty TypedDict, but the CDP spec defines a `font` field for this event. This change drops the event payload (FontFace) that clients should receive.</violation>
</file>
<file name="cdp_use/cdp/debugger/commands.py">
<violation number="1" location="cdp_use/cdp/debugger/commands.py:138">
P2: SetScriptSourceParameters drops the optional `allowTopFrameEditing` field that CDP still documents for Debugger.setScriptSource.</violation>
<violation number="2" location="cdp_use/cdp/debugger/commands.py:156">
P2: exceptionDetails should be optional in EvaluateOnCallFrameReturns; the protocol only includes it when an exception occurs.</violation>
<violation number="3" location="cdp_use/cdp/debugger/commands.py:189">
P2: EvaluateOnCallFrameParameters drops the optional `timeout` parameter, but CDP still supports it. This removes a documented option from the generated typing and blocks callers from using timeouts.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| """Whether the operation was successful or not. Only `Ok` denotes a | ||
| successful live edit while the other enum variants denote why | ||
| the live edit failed.""" | ||
| exceptionDetails: "ExceptionDetails" |
There was a problem hiding this comment.
P2: exceptionDetails should be optional in EvaluateOnCallFrameReturns; the protocol only includes it when an exception occurs.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At cdp_use/cdp/debugger/commands.py, line 156:
<comment>exceptionDetails should be optional in EvaluateOnCallFrameReturns; the protocol only includes it when an exception occurs.</comment>
<file context>
@@ -201,146 +135,86 @@ class SearchInContentReturns(TypedDict):
+ """Async stack trace, if any."""
+ asyncStackTraceId: "StackTraceId"
+ """Async stack trace, if any."""
+ exceptionDetails: "ExceptionDetails"
+ """Exception details if any."""
</file context>
| exceptionDetails: "ExceptionDetails" | |
| exceptionDetails: "NotRequired[ExceptionDetails]" |
|
@cubic review this |
@reformedot I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
4 issues found across 312 files
Note: This PR contains a large number of files. cubic only reviews up to 75 files per PR, so some files may not have been reviewed.
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="cdp_use/cdp/accessibility/commands.py">
<violation number="1" location="cdp_use/cdp/accessibility/commands.py:17">
P2: GetPartialAXTreeParameters no longer models backendNodeId/objectId and makes nodeId required, but the CDP spec allows any of nodeId/backendNodeId/objectId optionally. This breaks the protocol typing and blocks valid calls that identify nodes by backendNodeId/objectId.</violation>
</file>
<file name="cdp_use/cdp/dom/registration.py">
<violation number="1" location="cdp_use/cdp/dom/registration.py:240">
P3: Fix the typo in the distributedNodesUpdated docstring ("distrubution" → "distribution").</violation>
</file>
<file name="cdp_use/cdp/dom/events.py">
<violation number="1" location="cdp_use/cdp/dom/events.py:91">
P3: Fix the typo in the previous sibling description to keep the event documentation accurate.</violation>
<violation number="2" location="cdp_use/cdp/dom/events.py:151">
P3: Fix the spelling in the distributedNodes description.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
…se/cdp-use into feat/custom-cdp-domain
|
@cubic check this out |
@reformedot I have started the AI code review. It will take a few minutes to complete. |
There was a problem hiding this comment.
3 issues found across 70 files
Prompt for AI agents (all issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="cdp_use/cdp/accessibility/types.py">
<violation number="1" location="cdp_use/cdp/accessibility/types.py:100">
P3: Fix the typo in the docstring ("noode" → "node") to keep the generated type documentation readable.</violation>
</file>
<file name="cdp_use/cdp/network/types.py">
<violation number="1" location="cdp_use/cdp/network/types.py:476">
P2: Cookie.expires is documented as nullable, but the type annotation is still a plain float. This makes the type definition inconsistent with the documented payloads and will reject valid null values during typing/validation. Consider allowing None in the type (e.g., float | None).</violation>
</file>
<file name="cdp_use/generator/registry_generator.py">
<violation number="1" location="cdp_use/generator/registry_generator.py:85">
P2: handle_event only awaits handlers detected by inspect.iscoroutinefunction, so async callable objects/partials won’t be awaited and their coroutines are dropped. Invoke the handler first and await the result when it’s awaitable to avoid silently skipping async handlers.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| """Cookie expiration date as the number of seconds since the UNIX epoch.""" | ||
| """Cookie expiration date as the number of seconds since the UNIX epoch. | ||
| The value is set to -1 if the expiry date is not set. | ||
| The value can be null for values that cannot be represented in |
There was a problem hiding this comment.
P2: Cookie.expires is documented as nullable, but the type annotation is still a plain float. This makes the type definition inconsistent with the documented payloads and will reject valid null values during typing/validation. Consider allowing None in the type (e.g., float | None).
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At cdp_use/cdp/network/types.py, line 476:
<comment>Cookie.expires is documented as nullable, but the type annotation is still a plain float. This makes the type definition inconsistent with the documented payloads and will reject valid null values during typing/validation. Consider allowing None in the type (e.g., float | None).</comment>
<file context>
@@ -469,7 +471,10 @@ class Cookie(TypedDict):
- """Cookie expiration date as the number of seconds since the UNIX epoch."""
+ """Cookie expiration date as the number of seconds since the UNIX epoch.
+The value is set to -1 if the expiry date is not set.
+The value can be null for values that cannot be represented in
+JSON (±Inf)."""
size: "int"
</file context>
| - from 'checked' to 'selected': states which apply to widgets | ||
| - from 'activedescendant' to 'owns' - relationships between elements other than parent/child/sibling.""" | ||
| - from 'activedescendant' to 'owns': relationships between elements other than parent/child/sibling | ||
| - from 'activeFullscreenElement' to 'uninteresting': reasons why this noode is hidden""" |
There was a problem hiding this comment.
P3: Fix the typo in the docstring ("noode" → "node") to keep the generated type documentation readable.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At cdp_use/cdp/accessibility/types.py, line 100:
<comment>Fix the typo in the docstring ("noode" → "node") to keep the generated type documentation readable.</comment>
<file context>
@@ -90,13 +90,14 @@ class AXValue(TypedDict):
- from 'checked' to 'selected': states which apply to widgets
-- from 'activedescendant' to 'owns' - relationships between elements other than parent/child/sibling."""
+- from 'activedescendant' to 'owns': relationships between elements other than parent/child/sibling
+- from 'activeFullscreenElement' to 'uninteresting': reasons why this noode is hidden"""
</file context>
| - from 'activeFullscreenElement' to 'uninteresting': reasons why this noode is hidden""" | |
| - from 'activeFullscreenElement' to 'uninteresting': reasons why this node is hidden""" |
|
@cubic check this out man! |
@reformedot I have started the AI code review. It will take a few minutes to complete. |
Added browser-use custom CDP domain + option to define CDP version + updated specification
Summary by cubic
Adds a custom BrowserUse CDP domain with captcha events and ActiveTargetChanged, and lets us pin the CDP spec version. Updates the generator, syncs to the latest CDP, and adds linting, tasks, and packaging improvements.
New Features
Migration
Written for commit 5bd5e01. Summary will update on new commits.