Repository navigation
Conversation
1. Fix Playwright chrome channel validation in `browser_manager.py`: - `is_chrome_available()` was returning True for system Chromium, causing Playwright to request `channel="chrome"` which expects real Google Chrome. - Replaced with a strict check against Playwright's actual expected Chrome paths so it falls back to bundled Chromium correctly. 2. Fix image generation settings selector in `ui_automation.py`: - `GEN_SETTINGS_BUTTON_SELECTORS` lacked the `aria-haspopup='menu'` attribute and missed the `crop_original` icon. - Without it, the selector failed to find the panel after switching to image mode, leaving Flow's default generation count (2) active while the CLI only expected 1. 3. Warn on silent extra image generation in `client.py`: - If Flow generates more images than requested (e.g. 2 instead of 1 due to the settings panel miss), `_drive_image_generation` silently discarded the extras. - A warning is now logged showing the extra media IDs, alerting users to the extra credit consumption while preserving the single-image API contract.
|
Thanks for the contribution. This PR has been marked as an external contribution and routed for maintainer review. Before merge, please make sure:
GitHub Copilot code review may be requested as an advisory first pass, but maintainer approval is still required. |
ffroliva
left a comment
There was a problem hiding this comment.
Thank you for this @C1ph3r404 — both root causes are real and your fixes are correct. We ran a multi-dimensional council review and the three changes hold up:
channel_for_profile()gating on a Playwright-specific Chrome check correctly fixes theChromium distribution 'chrome' is not found at /opt/google/chrome/chromefailure on Chromium-only hosts —is_chrome_available()was too permissive there.- Requiring
button[aria-haspopup='menu']on the gen-settings selector fixes the mis-click that skipped the count panel and let Flow bill its own default count. - The
generate_image_extra_returnedwarning is a good observability add.
Council verdict: 🟡 YELLOW — correctness is sound; a few things to address before it can land:
- CHANGELOG — the
[Unreleased]section is empty; add a### Fixedblock for the three bugfixes. - DRY the selector —
GEN_SETTINGS_BUTTON_SELECTORSis now byte-identical toMODE_SWITCH_TRIGGER_SELECTORS(same button). Alias it (GEN_SETTINGS_BUTTON_SELECTORS = MODE_SWITCH_TRIGGER_SELECTORS) so the two call sites stay a single source of truth. - Narrow the Linux probe —
_is_playwright_chrome_channel_available()should check only/opt/google/chrome/chromeon Linux. The extra/usr/bin/google-chrome//usr/bin/google-chrome-stableentries would report the channel as available on hosts where Playwright'schannel="chrome"still can't resolve it — re-triggering the very error this PR fixes. - Tests — add unit coverage for (a) the
generate_image_extra_returnedwarning firing when 2 images are returned, and (b)_is_playwright_chrome_channel_available()returning False on a Chromium-only host.
Two notes for context:
- This PR is behind
develop(it predates the merged #225/#224), so it currently showsmergeable: unknownand needs a rebase. - It is not the fix for #222 — that turned out to be a
--password-store=basiclogin/generation asymmetry, resolved separately in #225. This PR fixes a distinct Chromium-only channel bug + the T2I over-generation bug.
We've co-landed your work in #226 (rebased on current develop, with the four items above applied) and live-verified the T2I path on a real-Chrome host — the gen-settings panel is now found, count locks to 1, and no extra image is generated. You're credited as co-author on that commit. We took this route because the fix needs verification on a host with Google Chrome proper, which a Chromium-only environment can't do. Closing this in favor of #226 once it merges — but huge thanks for the diagnosis and the fix. 🙏
fix(browser,image): co-land #219 — Chromium-only channel gate + T2I extra-image guard
|
Co-landed as #226 (now merged into |
…ge guard (ffroliva#219) Co-lands PR ffroliva#219 (Chrome profile + T2I extra-image bugs) with the council's required must-fixes folded in. Changes: - browser_manager: add `_is_playwright_chrome_channel_available()` probing only the exact Google-Chrome paths Playwright hardcodes; `channel_for_profile()` gates `channel="chrome"` on it instead of `is_chrome_available()` (which also accepts Chromium). Fixes the misleading "Chromium distribution 'chrome' is not found at /opt/google/chrome/chrome" on Chromium-only hosts. Linux probe is limited to `/opt/google/chrome/chrome` only (must-fix ffroliva#3 — the over-broad `/usr/bin/google-chrome*` paths would re-trigger the very error fixed here). - ui_automation: `GEN_SETTINGS_BUTTON_SELECTORS` aliased to `MODE_SWITCH_TRIGGER_SELECTORS` (must-fix #2 — single source of truth); both require `button[aria-haspopup='menu']`, preventing a mis-click that skipped the count panel and left Flow's default count (≈2) billing extra generations. - client: `generate_image()` logs `client.generate_image_extra_returned` when the transport returns more images than the requested count=1. - CHANGELOG: add [Unreleased] ### Fixed block (must-fix #1). - tests: extra-image warning fires on 2 images (+ negative case); `_is_playwright_chrome_channel_available()` Chromium-only → False (must-fix ffroliva#4). Co-Authored-By: C1ph3r404 <C1ph3r404@users.noreply.github.com>
…ge guard (ffroliva#219) Co-lands PR ffroliva#219 (Chrome profile + T2I extra-image bugs) with the council's required must-fixes folded in. Changes: - browser_manager: add `_is_playwright_chrome_channel_available()` probing only the exact Google-Chrome paths Playwright hardcodes; `channel_for_profile()` gates `channel="chrome"` on it instead of `is_chrome_available()` (which also accepts Chromium). Fixes the misleading "Chromium distribution 'chrome' is not found at /opt/google/chrome/chrome" on Chromium-only hosts. Linux probe is limited to `/opt/google/chrome/chrome` only (must-fix ffroliva#3 — the over-broad `/usr/bin/google-chrome*` paths would re-trigger the very error fixed here). - ui_automation: `GEN_SETTINGS_BUTTON_SELECTORS` aliased to `MODE_SWITCH_TRIGGER_SELECTORS` (must-fix ffroliva#2 — single source of truth); both require `button[aria-haspopup='menu']`, preventing a mis-click that skipped the count panel and left Flow's default count (≈2) billing extra generations. - client: `generate_image()` logs `client.generate_image_extra_returned` when the transport returns more images than the requested count=1. - CHANGELOG: add [Unreleased] ### Fixed block (must-fix ffroliva#1). - tests: extra-image warning fires on 2 images (+ negative case); `_is_playwright_chrome_channel_available()` Chromium-only → False (must-fix ffroliva#4). Co-Authored-By: C1ph3r404 <C1ph3r404@users.noreply.github.com>
fix(browser,image): co-land ffroliva#219 — Chromium-only channel gate + T2I extra-image guard
Summary
Fix Playwright chrome channel validation in
browser_manager.py:is_chrome_available()was returning True for system Chromium, causing Playwright to requestchannel="chrome"which expects real Google Chrome.Fix image generation settings selector in
ui_automation.py:GEN_SETTINGS_BUTTON_SELECTORSlacked thearia-haspopup='menu'attribute and missed thecrop_originalicon.Warn on silent extra image generation in
client.py:_drive_image_generationsilently discarded the extras.