Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

@waleedlatif1 waleedlatif1 commented Jan 19, 2026

Summary

  • upgraded browseruse endpoints to v2
  • updated docs

Type of Change

  • Bug fix
  • Documentation

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Jan 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
docs Ready Ready Preview, Comment Jan 19, 2026 10:40pm

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 19, 2026

Greptile Summary

This PR upgrades the BrowserUse integration from API v1 to v2. The main changes include:

  • API Endpoint Migration: Updated all API calls from /api/v1/ to /api/v2/tasks endpoints
  • Authentication Change: Switched from Authorization: Bearer header to X-Browser-Use-API-Key header
  • Improved Polling Logic: Streamlined the status polling mechanism to use a single endpoint (GET /api/v2/tasks/{taskId}) instead of separate status and task endpoints, eliminating redundant API calls
  • Icon Improvements: Standardized BrowserUseIcon to use 28x28 sizing and currentColor fill for better theme compatibility
  • Branding Update: Changed background color from light gray (#E0E0E0) to dark (#181C1E) to match new branding

Unrelated Changes:

  • Added glob@13.0.0 package dependency (purpose unclear from PR context)
  • Enhanced Google Slides documentation with detailed metadata field descriptions (unrelated to browseruse)

Confidence Score: 4/5

  • Safe to merge with minor concerns about unrelated changes
  • The browseruse v2 API migration is well-implemented with cleaner polling logic and proper authentication updates. The changes are straightforward and the refactoring reduces code complexity. Score is 4 instead of 5 due to two unrelated changes (glob package addition and google_slides documentation) that should ideally be in separate PRs for better change tracking and atomicity.
  • Review package.json and apps/docs/content/docs/en/tools/google_slides.mdx to understand if unrelated changes are intentional or should be separated

Important Files Changed

Filename Overview
apps/sim/tools/browser_use/run_task.ts Upgraded API endpoints from v1 to v2, changed authentication header from Bearer token to X-Browser-Use-API-Key, and streamlined polling logic
apps/sim/blocks/blocks/browser_use.ts Updated bgColor from light gray to dark color to match new branding
apps/docs/content/docs/en/tools/google_slides.mdx Added detailed documentation for nested metadata fields in tool outputs
package.json Added glob@13.0.0 as a direct dependency

Sequence Diagram

sequenceDiagram
    participant Client as Sim Client
    participant Tool as runTaskTool
    participant API as BrowserUse API v2
    
    Client->>Tool: Execute browser_use_run_task
    Note over Client,Tool: Pass task, apiKey, variables, model, etc.
    
    Tool->>API: POST /api/v2/tasks
    Note over Tool,API: Headers: X-Browser-Use-API-Key
    Note over Tool,API: Body: task, secrets, llm_model, etc.
    API-->>Tool: Response with task ID
    
    Tool->>API: GET /api/v2/tasks/{taskId}
    Note over Tool,API: Initial fetch for live_url
    API-->>Tool: Task data with live_url
    Tool->>Tool: Log live URL if available
    
    loop Poll every 5s (max 3 min)
        Tool->>API: GET /api/v2/tasks/{taskId}
        Note over Tool,API: Headers: X-Browser-Use-API-Key
        API-->>Tool: Task status and data
        
        alt Status is finished/failed/stopped
            Tool-->>Client: Return final result
        else Status is running
            Tool->>Tool: Log live URL (first time only)
            Tool->>Tool: Wait 5 seconds
        end
    end
    
    alt Timeout reached
        Tool-->>Client: Return timeout error
    end
Loading

@waleedlatif1 waleedlatif1 merged commit 81cbfe7 into staging Jan 19, 2026
12 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/bu branch January 19, 2026 22:47
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