Skip to content

[Bug]: Browser profile selection bug: chrome profile overrides openclaw even when explicitly specified #28687

@godenjan

Description

@godenjan

Summary

Browser tool incorrectly uses 'chrome' (extension) profile even when 'openclaw' profile is explicitly specified, causing "Chrome extension relay is running" error.

Steps to reproduce

  1. Start OpenClaw gateway
  2. Attempt to use browser tool with profile: "openclaw"
    Example: browser.open({profile: "openclaw", targetUrl: "https://example.com"})
  3. Observe the error: "Chrome extension relay is running, but no tab is connected"

Even though user explicitly specifies "openclaw" profile, the browser tool uses the auto-created "chrome" profile (driver: "extension") instead.

Expected behavior

When user explicitly specifies profile: "openclaw", the browser tool should use the OpenClaw-managed Chrome browser (CDP mode), not the Chrome extension relay mode.

Actual behavior

Browser tool throws error: "Chrome extension relay is running, but no tab is connected. Click the OpenClaw Chrome extension icon on a tab to attach it (profile "chrome")."

The error occurs because the browser tool uses the auto-created "chrome" profile (driver: "extension") instead of the explicitly specified "openclaw" profile.

OpenClaw version

2026.2.26

Operating system

macOS 12.7.6

Install method

Installed via npm global (v22.22.0)

Logs, screenshots, and evidence

**Root Cause Analysis:**

The bug is in the browser profile selection logic in `browser-profiles-service.ts`:

1. **Auto-creation of chrome profile** (line ~2816-2820):

function ensureDefaultChromeExtensionProfile(profiles, controlPort) {
    result.chrome = {
        driver: "extension",  // ← Sets driver to "extension"
        cdpUrl: `http://127.0.0.1:${relayPort}`,
        color: "#00AA00"
    };
}


2. **Default profile selection** (line ~2852):

const defaultProfile = defaultProfileFromConfig ?? 
    (profiles[DEFAULT_BROWSER_DEFAULT_PROFILE_NAME] ? DEFAULT_BROWSER_DEFAULT_PROFILE_NAME : ...);
// DEFAULT_BROWSER_DEFAULT_PROFILE_NAME = "chrome"


Since `chrome` profile is auto-created with `driver: "extension"`, it becomes the default even when user specifies `profile: "openclaw"`.

**File locations:**
- `dist/plugin-sdk/pi-embedded-helpers-CNodvx-y.js`
- Function: `ensureDefaultChromeExtensionProfile()`
- Default profile selection logic in `resolveBrowserConfig()`

**Temporary workaround:**
Add to `~/.openclaw/openclaw.json`:

{
  "browser": {
    "defaultProfile": "openclaw"
  }
}

Impact and severity

Affected: All OpenClaw users who want to use the built-in browser (openclaw profile)
Severity: High - Blocks browser functionality entirely when trying to use openclaw profile
Frequency: 100% - Reproducible every time
Consequence: Users cannot use the browser tool with openclaw profile and receive confusing error message about Chrome extension relay.

Users must manually add defaultProfile: "openclaw" to their config to work around this issue.

Additional information

Suggested fix:

Option 1: Don't automatically set chrome as the default profile

  • The auto-created chrome profile should only be used when Chrome extension relay is actually needed

Option 2: Respect explicit profile selection

  • When user explicitly specifies a profile (e.g., profile: "openclaw"), use that profile instead of falling back to the auto-created chrome profile

Option 3: Add configuration for default profile

  • Already partially implemented via defaultProfile config, but the logic should prioritize user-specified profile over auto-created chrome

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions