fix: retry agent-browser open - close/open race kills ~50% of clone runs - #15
Open
gkastanis wants to merge 1 commit into
Open
fix: retry agent-browser open - close/open race kills ~50% of clone runs#15gkastanis wants to merge 1 commit into
gkastanis wants to merge 1 commit into
Conversation
…runs
agent-browser close tears down the daemon socket; the next open can arrive
before it is recreated ('Failed to connect: os error 2'). Measured ~50%
failure on a bare close-then-open. New lib/browser.js browserOpen() retries
with linear backoff (300/600/900ms); all nine open call sites across eight
job files route through it. Validated on a live pipeline: 0 failures in 6
runs versus 3 in 6 before. Also fixes 03b-extract-assets interpolating the
URL into the shell unquoted.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
agent-browser closetears down the daemon's unix socket, and the nextopencan arrive before it is recreated, producingCould not configure browser: Failed to connect: No such file or directory (os error 2)and a dead run - most often at the mobile-screenshot step, since job 01 ends with a close and 01b starts with an open.I measured roughly a 50% failure rate on a bare close-then-open sequence. There are nine
opencall sites across eight job files, so patching one site just moves the failure. This addslib/browser.jswith abrowserOpen()helper that retries with linear backoff (300/600/900ms) and routes all nine call sites through it.It also switches the invocation to
execFileSyncargv form (no shell), which fixes03b-extract-assets.jsinterpolating the target URL into the shell unquoted - a URL containing$(), backticks, or spaces breaks or executes today.How I verified
$()and backticks through the new helper; it opens as data, nothing executes.node --checkpasses on all touched files.