Skip to content

Commit 725dc66

Browse files
committed
perf: use Spawn for supervisorctl start, rely on SDK retry
The SDK's Playwright.Execute has built-in retry, so we can fire and forget the supervisorctl start command instead of waiting for it.
1 parent 1aa9c80 commit 725dc66

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

internal/claude/loader.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,11 @@ func LoadIntoBrowser(ctx context.Context, opts LoadIntoBrowserOptions) error {
130130
}
131131

132132
// Restart Chromium to pick up the new pinned extension preference
133-
// Use Exec to wait for it to start before navigating
134-
_, _ = proc.Exec(ctx, opts.BrowserID, kernel.BrowserProcessExecParams{
135-
Command: "supervisorctl",
136-
Args: []string{"start", "chromium"},
137-
AsRoot: kernel.Opt(true),
138-
TimeoutSec: kernel.Opt(int64(30)),
133+
// Use Spawn (fire and forget) - the Playwright call below will retry until Chrome is ready
134+
_, _ = proc.Spawn(ctx, opts.BrowserID, kernel.BrowserProcessSpawnParams{
135+
Command: "supervisorctl",
136+
Args: []string{"start", "chromium"},
137+
AsRoot: kernel.Opt(true),
139138
})
140139

141140
// Step 4: Close extra tabs and navigate to chrome://newtab

0 commit comments

Comments
 (0)