Skip to content

fix(browser,image): co-land #219 — Chromium-only channel gate + T2I extra-image guard - #226

Merged
ffroliva merged 2 commits into
developfrom
bugfix/219-followup
Jun 29, 2026
Merged

ffroliva merged 2 commits into
developfrom
bugfix/219-followup

Conversation

@ffroliva

Copy link
Copy Markdown
Owner

Summary

Co-lands #219 (by @C1ph3r404 — resolve Chrome profile and T2I extra-image generation bugs) onto current develop, with the council-required must-fixes folded in. #219 is behind develop (pre-dates the merged #225/#224) and could not be live-verified by the contributor (likely a Chromium-only host); this branch re-applies the three root-cause changes, addresses the review, and adds the missing tests. Live-verified on a real-Chrome host (see Test plan).

Refs #219. Not the #222 fix — #222 was resolved separately by #225 (--password-store=basic asymmetry). This fixes a distinct Chromium-only channel bug + a T2I over-generation bug.

Changes (the 3 from #219)

  1. browser_manager.py — new _is_playwright_chrome_channel_available() probing only the exact Google-Chrome paths Playwright hardcodes; channel_for_profile() now 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 — falls back to bundled Chromium with an actionable warning.
  2. ui_automation.py — GEN_SETTINGS_BUTTON_SELECTORS now requires button[aria-haspopup='menu'], preventing a mis-click on an icon-only aspect thumbnail that skipped the count panel and left Flow's default count (~2) billing extra generations.
  3. client.py — generate_image() logs client.generate_image_extra_returned when the transport returns more images than the requested count=1.

Council must-fixes applied

  1. CHANGELOG — added an [Unreleased] ### Fixed block for the three bugfixes.
  2. DRY selector — GEN_SETTINGS_BUTTON_SELECTORS = MODE_SWITCH_TRIGGER_SELECTORS (single source of truth; they target the same button).
  3. Narrowed Linux probe — _is_playwright_chrome_channel_available() checks only /opt/google/chrome/chrome on Linux; dropped the over-broad /usr/bin/google-chrome* paths that would re-trigger the very error being fixed.
  4. Tests — extra-image warning fires on 2 images (+ negative case); _is_playwright_chrome_channel_available() Chromium-only → False (+ positive + env-override cases).

Also: client uses the module-level logger (no redundant local import structlog).

Test plan

  • /gflow:check: hygiene ✅, ruff ✅, pyright src 0 errors ✅, scoped tests 908 passed / 7 skipped ✅ (incl. 5 new tests).
  • Live-verify (credit-free image t2i, headed, real Chrome, profile denon82): image_mode_entered ✅, gen-settings panel found (panel_currently_visible: true, no gen_settings_panel_not_found) ✅, count desired=1 → final=1 success=true ✅, no generate_image_extra_returned ✅, exactly 1 image saved, exit 0 ✅.

🤖 Generated with Claude Code

Co-authored-by: C1ph3r404 C1ph3r404@users.noreply.github.com

…ge guard (#219)

Co-lands PR #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 #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 #4).

Co-Authored-By: C1ph3r404 <C1ph3r404@users.noreply.github.com>
…nar new_coverage)

Adds win32 (Program Files path) and darwin (/Applications app-bundle) coverage
for _is_playwright_chrome_channel_available(); the linux-only tests left those
two branches uncovered, dropping PR new_coverage to 78.6% (< 80% gate).
@ffroliva
ffroliva merged commit b142694 into develop Jun 29, 2026
9 checks passed
@ffroliva
ffroliva deleted the bugfix/219-followup branch June 29, 2026 21:37
15990166686ll-crypto pushed a commit to 15990166686ll-crypto/gflow-cli that referenced this pull request Aug 24, 2026
fix(browser,image): co-land ffroliva#219 — Chromium-only channel gate + T2I extra-image guard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant