Repository navigation
fix(google): treat gemini-3.5-flash as Gemini 3 Flash - #6247
user-Param wants to merge 8 commits into
Conversation
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
There was a problem hiding this comment.
6 issues found across 7 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="browser_use/browser/session.py">
<violation number="1" location="browser_use/browser/session.py:3026">
P3: This duplicates the JavaScript fallback that already runs above. When the first attempt returns no usable rectangle or raises, the added block repeats both CDP calls for the same node; move the existing fallback below quad validation or factor it into one shared block.</violation>
</file>
<file name="browser_use/llm/schema.py">
<violation number="1" location="browser_use/llm/schema.py:109">
P2: `default` still passes through recursive optimization because it appears in the earlier validation-key list, so this preservation clause never runs. Move the preservation branch before that list and remove `default` from the list.</violation>
<violation number="2" location="browser_use/llm/schema.py:110">
P2: The new as-is handling is undone by the later whole-tree passes, which still treat `examples` and `const` contents as schemas. Skip these data-valued keys during schema-only normalization so arbitrary example and const values remain unchanged.</violation>
</file>
<file name="browser_use/actor/element.py">
<violation number="1" location="browser_use/actor/element.py:326">
P1: `press_attempted` is true for both successful and failed presses, so this branch swallows `mouseReleased` errors after a successful press. `click()` can then report success while Chrome’s button state remains pressed; track whether the press actually failed and suppress release errors only in that case.</violation>
</file>
<file name="browser_use/browser/cloud/cloud.py">
<violation number="1" location="browser_use/browser/cloud/cloud.py:118">
P2: `error_msg` drops the previous subscription guidance whenever a 403 has no parseable `detail`, such as an HTML or empty response. Keep the subscription message as the fallback, then append `detail` when available.</violation>
</file>
<file name="browser_use/llm/anthropic/serializer.py">
<violation number="1" location="browser_use/llm/anthropic/serializer.py:18">
P3: This import is unused and triggers the repository's enabled Ruff `F` lint rules. Remove `ContentPartRefusalParam` from the import list.</violation>
</file>
Heads up: you’re close to your flex budget. Increase your flex budget so reviews don’t pause.
View guided diff | Re-trigger cubic
| ) | ||
| except Exception as release_exc: | ||
| # If the press already failed, keep the original error. | ||
| if press_attempted: |
There was a problem hiding this comment.
P1: press_attempted is true for both successful and failed presses, so this branch swallows mouseReleased errors after a successful press. click() can then report success while Chrome’s button state remains pressed; track whether the press actually failed and suppress release errors only in that case.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At browser_use/actor/element.py, line 326:
<comment>`press_attempted` is true for both successful and failed presses, so this branch swallows `mouseReleased` errors after a successful press. `click()` can then report success while Chrome’s button state remains pressed; track whether the press actually failed and suppress release errors only in that case.</comment>
<file context>
@@ -306,20 +306,33 @@ async def click(
+ )
+ except Exception as release_exc:
+ # If the press already failed, keep the original error.
+ if press_attempted:
+ try:
+ import logging
</file context>
|
|
||
| # Preserve default, examples, const values as-is (they're data, not schemas) | ||
| elif key in ('default', 'examples', 'const'): | ||
| optimized[key] = value |
There was a problem hiding this comment.
P2: The new as-is handling is undone by the later whole-tree passes, which still treat examples and const contents as schemas. Skip these data-valued keys during schema-only normalization so arbitrary example and const values remain unchanged.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At browser_use/llm/schema.py, line 110:
<comment>The new as-is handling is undone by the later whole-tree passes, which still treat `examples` and `const` contents as schemas. Skip these data-valued keys during schema-only normalization so arbitrary example and const values remain unchanged.</comment>
<file context>
@@ -105,6 +105,10 @@ def optimize_schema(obj: Any, defs_lookup: dict[str, Any] | None = None, *, in_p
+ # Preserve default, examples, const values as-is (they're data, not schemas)
+ elif key in ('default', 'examples', 'const'):
+ optimized[key] = value
+
# Recursively process all other fields
</file context>
| optimized[key] = value if not isinstance(value, (dict, list)) else optimize_schema(value, defs_lookup) | ||
|
|
||
| # Preserve default, examples, const values as-is (they're data, not schemas) | ||
| elif key in ('default', 'examples', 'const'): |
There was a problem hiding this comment.
P2: default still passes through recursive optimization because it appears in the earlier validation-key list, so this preservation clause never runs. Move the preservation branch before that list and remove default from the list.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At browser_use/llm/schema.py, line 109:
<comment>`default` still passes through recursive optimization because it appears in the earlier validation-key list, so this preservation clause never runs. Move the preservation branch before that list and remove `default` from the list.</comment>
<file context>
@@ -105,6 +105,10 @@ def optimize_schema(obj: Any, defs_lookup: dict[str, Any] | None = None, *, in_p
optimized[key] = value if not isinstance(value, (dict, list)) else optimize_schema(value, defs_lookup)
+ # Preserve default, examples, const values as-is (they're data, not schemas)
+ elif key in ('default', 'examples', 'const'):
+ optimized[key] = value
+
</file context>
| ) | ||
| elif response.status_code == 403: | ||
| raise CloudBrowserAuthError('Access forbidden. Please check your browser-use cloud subscription status.') | ||
| error_msg = 'Access forbidden.' |
There was a problem hiding this comment.
P2: error_msg drops the previous subscription guidance whenever a 403 has no parseable detail, such as an HTML or empty response. Keep the subscription message as the fallback, then append detail when available.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At browser_use/browser/cloud/cloud.py, line 118:
<comment>`error_msg` drops the previous subscription guidance whenever a 403 has no parseable `detail`, such as an HTML or empty response. Keep the subscription message as the fallback, then append `detail` when available.</comment>
<file context>
@@ -115,7 +115,14 @@ async def create_browser(
)
elif response.status_code == 403:
- raise CloudBrowserAuthError('Access forbidden. Please check your browser-use cloud subscription status.')
+ error_msg = 'Access forbidden.'
+ try:
+ error_data = response.json()
</file context>
| error_msg = 'Access forbidden.' | |
| error_msg = 'Access forbidden. Please check your browser-use cloud subscription status.' |
| if width > 0 and height > 0: | ||
| return DOMRect(x=min_x, y=min_y, width=width, height=height) | ||
|
|
||
| # Fall back to JavaScript getBoundingClientRect |
There was a problem hiding this comment.
P3: This duplicates the JavaScript fallback that already runs above. When the first attempt returns no usable rectangle or raises, the added block repeats both CDP calls for the same node; move the existing fallback below quad validation or factor it into one shared block.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At browser_use/browser/session.py, line 3026:
<comment>This duplicates the JavaScript fallback that already runs above. When the first attempt returns no usable rectangle or raises, the added block repeats both CDP calls for the same node; move the existing fallback below quad validation or factor it into one shared block.</comment>
<file context>
@@ -2959,23 +2959,104 @@ async def get_element_coordinates(self, backend_node_id: int, cdp_session: CDPSe
+ if width > 0 and height > 0:
+ return DOMRect(x=min_x, y=min_y, width=width, height=height)
+
+ # Fall back to JavaScript getBoundingClientRect
+ try:
+ result = await cdp_session.cdp_client.send.DOM.resolveNode(
</file context>
| AssistantMessage, | ||
| BaseMessage, | ||
| ContentPartImageParam, | ||
| ContentPartRefusalParam, |
There was a problem hiding this comment.
P3: This import is unused and triggers the repository's enabled Ruff F lint rules. Remove ContentPartRefusalParam from the import list.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At browser_use/llm/anthropic/serializer.py, line 18:
<comment>This import is unused and triggers the repository's enabled Ruff `F` lint rules. Remove `ContentPartRefusalParam` from the import list.</comment>
<file context>
@@ -15,6 +15,7 @@
AssistantMessage,
BaseMessage,
ContentPartImageParam,
+ ContentPartRefusalParam,
ContentPartTextParam,
SupportedImageMediaType,
</file context>
|
@gregpr07 Could you please review this PR? All tests pass and the fix addresses a real issue. Thank you! |
|
def-Param seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
Fixes #6063 - ChatGoogle was treating gemini-3.5-flash as Gemini 2.5, dropping thinking_level. The fix adds gemini-3.5-flash to the Gemini 3 Flash check.
Summary by cubic
Fixes #6063:
gemini-3.5-flashis now treated as a Gemini 3 Flash model inChatGoogle, so it gets the correctthinking_budgethandling instead of falling back to Gemini 2.5 behavior (which droppedthinking_level). Also bundles several unrelated bug fixes.Bug Fixes
mouseReleasedalso fails.detailmessage.DOM.getBoxModelorgetBoundingClientRect.[Refusal]prefix.default,examples, andconstvalues and handles user fields namedrequired.clean_old_cachesnow removes all matching files whenkeep_countis 0.Written for commit 8a78959. Summary will update on new commits.