Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Composer browser simulations: log the browser process on the retry (#13745)

Daniel Han5acd5cdde41c
diff --git a/.github/workflows/studio-composer-compatibility.yml b/.github/workflows/studio-composer-compatibility.yml
index 6d4ae52a9e1..fd4f8b366f9 100644
--- a/.github/workflows/studio-composer-compatibility.yml
+++ b/.github/workflows/studio-composer-compatibility.yml
@@ -157,7 +157,10 @@ jobs:
if "$@" > "$log" 2>&1; then return 0; fi
echo "::warning::$* failed on $browser, retrying once"
printf '\n=== first attempt failed, retrying ===\n\n' >> "$log"
- if "$@" >> "$log" 2>&1; then
+ # The retry logs the browser process too (launch, stderr, exit), so a webkit
+ # target that closes twice leaves why in the artifact instead of only
+ # TargetClosedError. Seen on two unrelated PRs, not reproducible off the runner.
+ if DEBUG=pw:browser "$@" >> "$log" 2>&1; then
echo "::notice::$* passed on $browser after one retry"
return 0
fi
diff --git a/tests/studio/test_browser_simulations_retry_once.py b/tests/studio/test_browser_simulations_retry_once.py
index e812fb76558..50ea4a4f630 100644
--- a/tests/studio/test_browser_simulations_retry_once.py
+++ b/tests/studio/test_browser_simulations_retry_once.py
@@ -104,3 +104,19 @@ def test_the_retry_is_bounded_at_one():
assert (
looping not in helper
), f"run_driver contains `{looping}`: the retry has to stay bounded at one"
+
+
+def test_the_retry_records_the_browser_process():
+ """A second TargetClosedError should say why the browser went away.
+
+ Only the retry carries DEBUG=pw:browser: a first-attempt pass stays quiet, and the
+ attempt that decides the leg logs the browser's launch, stderr and exit.
+ """
+ step = _step()
+ helper = step[step.index("run_driver()") : step.index("for browser in")]
+ first, second = [line.strip() for line in helper.splitlines() if '"$@"' in line]
+ assert "DEBUG=" not in first, "the first attempt should run exactly as before"
+ assert second.startswith('if DEBUG=pw:browser "$@"'), (
+ "the retry no longer records the browser process, so a twice-closed target "
+ "leaves no reason in the artifact"
+ )