Skip to content

Conversation

0xToshii
Copy link
Contributor

@0xToshii 0xToshii commented Jul 31, 2025

Related Issue

Issue: #XXXX

Description

The browser use tool does not work for Grok models due to our default for using webp formatted images, and Grok not supporting these. Originally we would get this error when sending the browser screen shots to Grok when using their provider: 400 "Invalid request content: Downloaded response does not contain a valid JPG or PNG image.". Fixed this by using png format for Grok models

Test Procedure

Tested browser use tool for grok-4, sonnet-4, and gemini-2.5-pro to check that browser use still works for all. Also tested with and without using the remote browser connection.

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • ♻️ Refactor Changes
  • 💅 Cosmetic Changes
  • 📚 Documentation update
  • 🏃 Workflow Changes

Pre-flight Checklist

  • Changes are limited to a single feature, bugfix or chore (split larger changes into separate PRs)
  • Tests are passing (npm test) and code is formatted and linted (npm run format && npm run lint)
  • I have created a changeset using npm run changeset (required for user-facing changes)
  • I have reviewed contributor guidelines

Screenshots

Using grok-4 in browser use:

grok.single.click.mov

Additional Notes


Important

Enhance ToolExecutor and BrowserSession to handle webp image support based on model capabilities, adding modelDoesntSupportWebp() function.

  • Behavior:
    • ToolExecutor now includes Grok4 model family in isNextGenModel checks in pushToolResult() and handleStreamingJsonReplacement().
    • BrowserSession constructor now accepts useWebp parameter to determine screenshot format.
    • BrowserSession uses modelDoesntSupportWebp() to decide between webp and png for screenshots.
  • Functions:
    • Adds modelDoesntSupportWebp() in model-utils.ts to check if a model supports webp images.
  • Misc:
    • Adjusts screenshot logic in doAction() and navigateTourl("") in BrowserSession to retry with png if webp fails.

This description was created by Ellipsis for be364d9. You can customize this summary. It will automatically update as commits are pushed.

Copy link

changeset-bot bot commented Jul 31, 2025

⚠️ No Changeset found

Latest commit: be364d9

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@0xToshii 0xToshii changed the title fix grok browser_user due to not being able to process webp images fix grok browser_user issue due to not being able to process webp images Jul 31, 2025
Copy link
Contributor

Coverage Report

Extension Coverage

Base branch: 47%

PR branch: 48%

✅ Coverage increased or remained the same

Webview Coverage

Base branch: 17%

PR branch: 17%

✅ Coverage increased or remained the same

Overall Assessment

Test coverage has been maintained or improved

Last updated: 2025-07-31T23:06:18.348902

Copy link
Contributor

@abeatrix abeatrix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look straightforward. Left some non blocking comments.

@0xToshii 0xToshii merged commit 9980cb0 into main Aug 1, 2025
16 of 17 checks passed
dtrugman pushed a commit to dtrugman/cline that referenced this pull request Aug 24, 2025
…cline#5278)

* Enhance provider selection with search functionality

* fix: add SearchableSelect mock to SettingsView.spec.tsx

- Added SearchableSelect to the @/components/ui mock in SettingsView.spec.tsx
- This resolves test failures after the SearchableSelect component was introduced
- All 497 tests now pass successfully

* test: add comprehensive tests for SearchableSelect component

* feat: address PR feedback

* fix: internationalize SearchableSelect placeholder in test mock

- Replace hardcoded 'Select...' with i18n key 'settings:common.select'
- Ensures consistency with actual component usage
- Addresses PR review feedback

---------

Co-authored-by: Daniel Riccio <ricciodaniel98@gmail.com>
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.

2 participants