← Back to PRs

#15690: feat(browser): add browser.args config field for custom Chrome launch flags (#14803)

by lailoo open 2026-02-13 18:49 View on GitHub →
agents stale size: XS trusted-contributor experienced-contributor
## Summary Add a `browser.args` config field that lets users append custom Chrome launch flags to the built-in set. This enables hardware-accelerated WebGL, custom ANGLE backends, and other Chrome flags without patching source code. **Example config:** ```json { "browser": { "enabled": true, "headless": true, "args": ["--use-angle=vulkan", "--enable-features=Vulkan"] } } ``` ## Problem Chrome launch arguments in `launchOpenClawChrome` are entirely hardcoded. Users with GPU-capable servers (e.g. AMD Radeon iGPU with Vulkan 1.4) cannot enable hardware-accelerated WebGL because `--headless=new --disable-gpu` is always passed and there is no way to add `--use-angle=vulkan`. ## Before (on main — real environment) ### Config level Called the real `resolveBrowserConfig` with `args: ["--use-angle=vulkan", "--enable-features=Vulkan"]`: ``` resolved config keys: enabled, evaluateEnabled, controlPort, cdpProtocol, cdpHost, cdpIsLoopback, remoteCdpTimeoutMs, remoteCdpHandshakeTimeoutMs, color, executablePath, headless, noSandbox, attachOnly, defaultProfile, profiles has "args" in resolved: false ❌ FEATURE GAP CONFIRMED (config): browser.args is silently dropped by resolveBrowserConfig ``` ### Launch level Called the real `launchOpenClawChrome` → real `spawnOnce()`, captured the full Chrome args array: ``` Chrome spawn args (15): --remote-debugging-port=19999 --user-data-dir=... --no-first-run --no-default-browser-check --disable-sync --disable-background-networking --disable-component-update --disable-features=Translate,MediaRouter --disable-session-crashed-bubble --hide-crash-restore-bubble --password-store=basic --headless=new --disable-gpu --disable-blink-features=AutomationControlled about:blank Contains --use-angle=vulkan: false ❌ FEATURE GAP CONFIRMED (launch): no mechanism to pass custom flags to Chrome ``` ## After (on fix branch) ``` ✓ passes extra args through to resolved config (#14803) ✓ defaults args to empty array when omitted ✓ filters out non-string and empty args entries Test Files 1 passed (1) Tests 15 passed (15) ``` ## Changes - `src/config/types.browser.ts`: add `args?: string[]` to `BrowserConfig` - `src/browser/config.ts`: add `args: string[]` to `ResolvedBrowserConfig`, parse and filter in `resolveBrowserConfig` - `src/browser/chrome.ts`: append `resolved.args` to Chrome launch arguments in `spawnOnce()` (before the final `about:blank` positional arg) - `src/browser/config.test.ts`: add 3 regression tests (passthrough, default empty, filter invalid entries) - `CHANGELOG.md`: add entry Closes #14803

Most Similar PRs