Disable Rod leakless launcher on Windows (#54)

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: DeepWiki Dev <dev@deepwiki.local>
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
Valid-Systems
2026-06-20 23:18:05 -04:00
committed by GitHub
parent 105e68f036
commit 1e59c10e6f
3 changed files with 17 additions and 1 deletions
+7
View File
@@ -0,0 +1,7 @@
package browser
import "runtime"
func launcherLeakless() bool {
return runtime.GOOS != "windows"
}
+1 -1
View File
@@ -165,7 +165,7 @@ func (p *Pool) getBrowser() (*rod.Browser, error) {
controlURL := p.opts.ControlURL
if controlURL == "" {
l := launcher.New().
l := launcher.New().Leakless(launcherLeakless()).
Headless(p.opts.Headless).
Set("disable-blink-features", "AutomationControlled").
Set("disable-gpu", "")
+9
View File
@@ -6,6 +6,7 @@ import (
"net/http"
"net/http/httptest"
"os"
"runtime"
"strings"
"testing"
"time"
@@ -83,6 +84,14 @@ func TestDisableSandboxContainer(t *testing.T) {
}
}
func TestLauncherLeaklessDisabledOnWindows(t *testing.T) {
got := launcherLeakless()
want := runtime.GOOS != "windows"
if got != want {
t.Errorf("launcherLeakless() = %v on %s; want %v", got, runtime.GOOS, want)
}
}
func TestRenderCapturesFinalDOM(t *testing.T) {
if testing.Short() {
t.Skip("render test drives Chrome; skipped under -short")