Repository navigation
feat(image): dedup i2i refs via picker filename search (#314) - #334
Merged
Merged
Conversation
…upload (#314) `_attach_references` uploaded every local ref, so a repeated ref piled up duplicate library entries (the reporter's 8× son.jpg). Flow names an uploaded file by its EXACT filename and the picker search filters on that name, so a repeat ref can be attached by selecting the existing tile — no duplicate upload, and without persisting or trusting any media UUID across runs. New soft helper `_try_select_existing_by_filename`: syncs the picker to the editor's project (the library is project-scoped, #287), searches the filename, and matches the tile by its image ALT (= the exact filename, locale-invariant — the option's accessible name also carries a localised "Image"/"Imagem" suffix, so an exact name match misses). On a match it selects + includes; on a miss it clears the filter and returns False so the caller uploads. Wired via a new opt-in `prefer_existing` flag — image i2i opts in; R2V video keeps upload-only. Live-verified on ffroliva (project 9d5b9a86, credit-free): a 2nd i2i of `zzdedupprobe.png` logged `reference_deduped_by_filename`, ZERO `image_uploaded`, and produced a real image (forced classic via --ui-mode). Dedup also fired in the agentic cohort. 6 unit tests + spike_issue314_picker_filename_search.py.
This was referenced Jul 17, 2026
Merged
15990166686ll-crypto
pushed a commit
to 15990166686ll-crypto/gflow-cli
that referenced
this pull request
Aug 24, 2026
…upload (ffroliva#314) (ffroliva#334) `_attach_references` uploaded every local ref, so a repeated ref piled up duplicate library entries (the reporter's 8× son.jpg). Flow names an uploaded file by its EXACT filename and the picker search filters on that name, so a repeat ref can be attached by selecting the existing tile — no duplicate upload, and without persisting or trusting any media UUID across runs. New soft helper `_try_select_existing_by_filename`: syncs the picker to the editor's project (the library is project-scoped, ffroliva#287), searches the filename, and matches the tile by its image ALT (= the exact filename, locale-invariant — the option's accessible name also carries a localised "Image"/"Imagem" suffix, so an exact name match misses). On a match it selects + includes; on a miss it clears the filter and returns False so the caller uploads. Wired via a new opt-in `prefer_existing` flag — image i2i opts in; R2V video keeps upload-only. Live-verified on ffroliva (project 9d5b9a86, credit-free): a 2nd i2i of `zzdedupprobe.png` logged `reference_deduped_by_filename`, ZERO `image_uploaded`, and produced a real image (forced classic via --ui-mode). Dedup also fired in the agentic cohort. 6 unit tests + spike_issue314_picker_filename_search.py.
ffroliva
added a commit
that referenced
this pull request
Oct 25, 2026
Council review: - the retry fires only when the ReferenceNotFoundError names a media id this run reused; a missing character or an out-of-order chip re-raises at once, with no duplicate upload - a file the upload check refuses keeps its pre-#772 route - the file size is checked before it is hashed - a live e2e scenario for a recorded image the project no longer holds - docs/USAGE.md describes the flow.google.com reuse; #334 -> issue #314
Intorain
pushed a commit
to Intorain/gflow-cli
that referenced
this pull request
Oct 26, 2026
…ffroliva#772) On flow.google.com every image i2i uploaded its --ref file again, so a loop over one character image filled the project's library with copies. The upload is now recorded in the catalog; a later run in the same project with the same file (same path, same bytes) mentions the recorded image in place. A recorded image deleted from the project since is uploaded again, recorded, and the generation retried once (nothing is submitted before the miss). Shared by the CLI and the MCP worker. Labs keeps its editor-dialog filename dedup (ffroliva#334): the transport answers None there and the path is left alone.
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.
Summary
Fixes #314: image i2i re-uploaded every local reference, piling up duplicate library entries (the reporter's 8×
son.jpg). Flow names an uploaded file by its exact filename and the picker search filters on that name — so a repeated ref is now attached by selecting the existing tile instead of re-uploading, without persisting or trusting any media UUID across runs.New soft helper
_try_select_existing_by_filename: syncs the picker to the editor's project (the library is project-scoped, #287), searches the filename, and matches the tile by its imagealt(= the exact filename, locale-invariant — the option's accessible name also carries a localized "Image"/"Imagem" suffix, so an exact name match misses). Match → select + include; miss → clear the filter, return False → caller uploads. Wired via an opt-inprefer_existingflag: image i2i opts in; R2V video keeps upload-only (zero video-side change).Live verification (the deciding evidence)
On
ffroliva, project9d5b9a86(credit-free), a 2nd i2i of the same ref:alt-match fixreference_deduped_by_filenamestatus: ok, real 54 KB JPEG — clean end-to-endSo the dedup fires in both cohorts and does not break generation (classic clean success). The agentic run's
TransportTimeoutErroris the cohort's pre-existing DOM-scrape flake (#281/#299), not caused by this change.Test plan
TestAttachReferencesDedup): match→select-no-upload, miss→clear+upload, no-search-box→upload, prefer_existing routing both ways, default→video-path-unchanged./gflow:check: ruff clean, pyright src 0/0/0, hygiene + doc-links clean, 305 transport tests pass.prefer_existingis justified branching — ship.scripts/dev/spike_issue314_picker_filename_search.py.🤖 Generated with Claude Code