Skip to content

Revert i2i ref-attach (PR #50, commit 529d335); keep teardown guard. Closes #56 - #57

Merged
ffroliva merged 1 commit into
developfrom
revert/pr-50-i2i-ref-attach
May 24, 2026
Merged

ffroliva merged 1 commit into
developfrom
revert/pr-50-i2i-ref-attach

Conversation

@ffroliva

Copy link
Copy Markdown
Owner

Summary

Reverts the i2i ref-attach half of #50 (commit 529d335). Keeps the __aenter__ teardown guard from 57d1746 — that fix is independent and worked correctly during this failure (no orphan chrome process). Closes #56.

Why

Live verification on the ffroliva Chrome-strategy profile post-merge (correlation_id cf4ae6a4-ff5a-4f41-9c82-0d2403ec4d6f) failed with an unhandled TimeoutError ~34s after count_setter_completed. The new _attach_references call in _generate_images_locked (ui_automation.py:1510) reuses the R2V helper (ui_automation_video.py:674); the helper clicks Add Media successfully but the OS file-chooser event never fires in image mode. Hypothesis: image-mode and video-mode share the add_2 button icon (locale-stable) but NOT its click semantics — image mode likely opens an intermediate menu (upload-from-device vs library) requiring a second click. PR #50's "same add_2 surface" assumption holds for the icon, not the post-click flow. Full diagnostic timeline + asks for @svasakorn in #56.

What is reverted

  • src/gflow_cli/api/image.py — drops GenerateImageRequest.ref_paths field
  • src/gflow_cli/api/transports/ui_automation.py — drops the if request.ref_paths: await self._attach_references(...) block
  • src/gflow_cli/cli_image.py — restores prior path/UUID handling (no ref_paths split)
  • tests/api/transports/test_ui_automation.py — drops the _attach_references await assertion
  • tests/cli/test_cli_image.py — restores prior assertions
  • CHANGELOG.md — drops the i2i bullet (teardown bullet retained)

What is NOT reverted (intentional)

  • src/gflow_cli/api/client.py — __aenter__ partial-setup leak guard from 57d1746 (independent fix, surfaced cleanly here)
  • tests/api/test_concurrency.py::test_aenter_partial_failure_tears_down_browser — its test
  • The teardown-guard bullet in CHANGELOG.md

Test plan

  • uv run ruff check src tests — clean
  • uv run ruff format --check src tests — 103 files already formatted
  • Scoped pytest (tests/cli/test_cli_image.py tests/api/transports/test_ui_automation.py tests/api/test_concurrency.py tests/api/test_image.py) — 158 passed
  • CI full suite (3.11/3.12/3.13)
  • Manual: gflow image i2i with a UUID --ref (the non-broken path) still works post-revert
  • After merge: confirm gflow image i2i --ref <local-file> now fails fast with a clear error (no silent UI hang), per pre-feat(image): i2i local-ref attach via media dialog (closes #39) + __aenter__ teardown guard #50 behavior

Notes

This reverts commit 529d335 (the i2i
half of PR #50). Closes #56.

Live verification on the ffroliva Chrome-strategy profile post-merge
(correlation_id cf4ae6a4-ff5a-4f41-9c82-0d2403ec4d6f) failed with an
unhandled TimeoutError ~34s after count_setter_completed. Structlog
timeline up to the failure:

  09:24:23.5Z  entered_editor
  09:24:25.4Z  image_mode_tab selector_matched
  09:24:26.9Z  image_mode_entered
  09:24:28.9Z  aspect_ratio_set 9:16
  09:24:29.0Z  count_setter_completed count=1
  (silent 34s gap)
  09:25:02.8Z  error_unhandled TimeoutError

The 34s gap is consistent with the 8s add_media.wait_for + ~30s default
Playwright wait inside _upload_via_open_dialog for a filechooser event
that never fired. Hypothesis: image-mode and video-mode share the
add_2 button icon (locale-stable) but NOT its click semantics — in
image mode, clicking Add Media likely opens an intermediate menu
(upload-from-device vs library) instead of going straight to the OS
file chooser. PR #50's "same add_2 surface" assumption holds for the
icon, not for the post-click flow. Full diagnostic + asks for the PR
author in issue #56.

The __aenter__ teardown guard from commit 57d1746a (the second commit
on PR #50) is intentionally KEPT — it surfaced cleanly during this
failure (no orphan chrome process, no profile lock for debug runs).

Tests: ruff clean, ruff format clean, 158 scoped tests pass
(tests/cli/test_cli_image.py, tests/api/transports/test_ui_automation.py,
tests/api/test_concurrency.py, tests/api/test_image.py).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: Flavio Oliva <ffroliva@gmail.com>
@ffroliva
ffroliva merged commit 5345c1b into develop May 24, 2026
6 checks passed
@ffroliva
ffroliva deleted the revert/pr-50-i2i-ref-attach branch May 26, 2026 09:32
15990166686ll-crypto pushed a commit to 15990166686ll-crypto/gflow-cli that referenced this pull request Aug 24, 2026
Revert i2i ref-attach (PR ffroliva#50, commit 2137f56); keep teardown guard. Closes ffroliva#56
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.

i2i ref attach (#50) fails with TimeoutError on ffroliva account; image-mode add-media flow likely differs from video R2V

1 participant