fix(Interceptor): test-profile auto-launch fails while Chrome is already running#1487
Open
anikinsasha wants to merge 1 commit into
Open
Conversation
…ady running On macOS, `open -a <browser> --args …` silently drops the arguments when the browser is already running — it just activates the existing window. Since the operator's working Chrome is normally open, LaunchTestProfile.sh could never open the test-profile window, so EnsureTestProfile's auto-recovery always timed out waiting for the pinned context and every workflow stopped at the gate. Invoke the browser binary directly instead: Chrome's process singleton forwards --profile-directory/--new-window to the running instance, so the profile window opens whether or not the browser was already up. `open -a` remains as a fallback when the binary isn't at the expected path. New optional override: INTERCEPTOR_TEST_BROWSER_BIN. Also add preferences.env.example documenting the contract variables the three gate/launch tools read (INTERCEPTOR_TEST_CONTEXT_ID, INTERCEPTOR_TEST_CHROME_PROFILE, optional browser overrides, working-profile deny-list) — currently they're only discoverable by reading the scripts, and a wrong guess at the variable name fails as 'no test profile configured'.
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.
Problem
Tools/LaunchTestProfile.sh(Darwin branch) launches the isolated test profile withopen -a "$BROWSER" --args …. macOS silently drops--argswhen the target app is already running —openjust activates the existing window. Since the operator's working Chrome is normally open, the test-profile window never opens,EnsureTestProfile.shpolls until timeout, and every browser workflow stops at the isolation gate with the context-not-connected remediation. The skill's own gotchas describe thisopen-already-running behavior, but the shipped launcher still uses the affected form.Fix
Invoke the browser binary directly (
/Applications/<Browser>.app/Contents/MacOS/<Browser> --profile-directory=… --new-window <url>): Chrome's process singleton forwards the arguments to the running instance, so the profile window opens whether or not the browser was already up.open -ais kept as a fallback when the binary isn't at the expected path (reliable only when the browser isn't running). New optional override:INTERCEPTOR_TEST_BROWSER_BIN.Also adds
preferences.env.exampledocumenting the contract variables the three gate/launch tools source (INTERCEPTOR_TEST_CONTEXT_ID,INTERCEPTOR_TEST_CHROME_PROFILE, optional browser overrides, working-profile deny-list). Today these are discoverable only by reading the scripts, and a wrong variable-name guess fails as "no test profile configured."Testing
With Chrome already running (working profile window open): before the patch,
EnsureTestProfile.shlaunches, no window appears, gate times out. After the patch, the test-profile window opens andinterceptor contextsshows the pinned context connected in ~6s; the gate prints READY. Fallback path unchanged when the binary is absent.bash -nclean.