You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Agentic-mode multi-candidate ambiguity guard fails after burning attempts #313
agentic.py's _compose_directive sends a natural-language "Make me a picture of X" (singular for count=1) rather than a hard UI count control. Google's agentic assistant can ignore this and generate multiple candidates. await_images' ambiguity guard (issue #281) refuses to guess and raises MediaAttributionError — but only after the generation already ran. This burns time and attempts with zero usable output.
Proposed Improvement
Enhance agentic mode's count enforcement, or modify await_images to download-and-let-caller-pick instead of hard-failing when multiple candidates are returned.
Corrected root cause + validated fix design (live-verified 2026-07-16)
Both proposed fixes in the issue body turn out to be non-viable on closer investigation — but a live check of the current Flow UI (thanks to a maintainer catch — the assumption below was wrong) surfaced the real mechanism and a validated fix.
"Download-and-let-caller-pick" — still correctly ruled out: breaks the exact-count invariant in _build_generated_images (agentic.py:600-614) and needs new CLI selection UX. Out of scope for this fix.
The actual mechanism (live-verified against a real Flow project)
Agent mode's composer has a tune (Settings) icon that opens a full "Agent settings" panel — not a small popover like classic mode's crop_* menu. It has:
"Video generation default": same shape, 2 aspect options + count tabs + model dropdown
"Save" button
Critically, this is a sticky default, not a per-message setting. On the test project it was found stuck on x2 from some prior state. gflow-cli's automation never touches this panel, so this leftover default silently overrides the natural-language "a picture" (singular) phrasing — that's the actual cause of the multi-candidate ambiguity, not the AI "ignoring" phrasing.
The image count control is reliably the first[role='tablist'] (DOM order) containing both 1x and x2 buttons — image section always renders before video section.
Click the button matching the requested count (1→1x .. 4→x4). Must use a real Playwright mouse click — a raw JS element.click() does not trigger this React app's selection handler (verified: aria-selected never flips with a synthetic click).
Click "Save" — no icon/data-attribute/aria-label available on this button and text is locale-dependent ("Salvar" in pt), so it needs a scoped selector: walk up from the arrow_back icon (present at the panel header) to the ancestor that also contains the count tablist, then take the last visible button within that scope. Verified this resolves to the same element as the Save button.
Save auto-closes the panel back to the composer (no extra back-arrow step needed) — verified the Slate composer textbox is visible immediately after.
Keep the existing natural-language phrasing (still needed to keep the agent's reasoning step engaged for project-brief instruction cards, per the 2026-07-08 finding already in _compose_directive's docstring) — the UI control becomes authoritative, phrasing stays as reinforcement.
Keep the existing MediaAttributionError fail-fast guard as a backstop for the rare case the agent still ignores both signals.
Scope stays count-only (no aspect/model automation via this panel) to match the issue as filed.
Implementation pending — this is a larger/riskier change than originally scoped (new locale-invariant selectors driving a previously-undocumented settings surface), so it'll go through subagent-driven development with task-level review before merge.
Closed automatically by merging #325 to develop (commit df8f8ea). Live e2e-verified before merge: deliberately set a real Flow project's sticky count default to x3 (a mismatch), then requested 1 image via gflow image t2i — got exactly 1 back, no MediaAttributionError. Will ship to main in the next release.
Activity
ffroliva commentedon Jul 16, 2026
Corrected root cause + validated fix design (live-verified 2026-07-16)
Both proposed fixes in the issue body turn out to be non-viable on closer investigation — but a live check of the current Flow UI (thanks to a maintainer catch — the assumption below was wrong) surfaced the real mechanism and a validated fix.
What's wrong with the original proposals
configure_image_settingsdocstring says agentic settings are "resolved from natural language"; a 33-day-old memory documented Agent mode removing the whole settings panel, PR fix(transports): exit Agent composer mode before mode switch so the gen panel mounts #124/fix(transports): handle Flow's Agent chat-panel shape in _exit_agent_mode #138). This was stale. Flow's UI has since added a real settings surface — see below._build_generated_images(agentic.py:600-614) and needs new CLI selection UX. Out of scope for this fix.The actual mechanism (live-verified against a real Flow project)
Agent mode's composer has a
tune(Settings) icon that opens a full "Agent settings" panel — not a small popover like classic mode'scrop_*menu. It has:1x/x2/x3/x4) + model dropdownCritically, this is a sticky default, not a per-message setting. On the test project it was found stuck on
x2from some prior state. gflow-cli's automation never touches this panel, so this leftover default silently overrides the natural-language "a picture" (singular) phrasing — that's the actual cause of the multi-candidate ambiguity, not the AI "ignoring" phrasing.Validated fix mechanics
tune(ligature-based selector, locale-invariant).[role='tablist'](DOM order) containing both1xandx2buttons — image section always renders before video section.1x.. 4→x4). Must use a real Playwright mouse click — a raw JSelement.click()does not trigger this React app's selection handler (verified:aria-selectednever flips with a synthetic click).arrow_backicon (present at the panel header) to the ancestor that also contains the count tablist, then take the last visible button within that scope. Verified this resolves to the same element as the Save button._compose_directive's docstring) — the UI control becomes authoritative, phrasing stays as reinforcement.MediaAttributionErrorfail-fast guard as a backstop for the rare case the agent still ignores both signals.Scope stays count-only (no aspect/model automation via this panel) to match the issue as filed.
Implementation pending — this is a larger/riskier change than originally scoped (new locale-invariant selectors driving a previously-undocumented settings surface), so it'll go through subagent-driven development with task-level review before merge.
Merge pull request #325 from ffroliva/feature/agentic-count-enforcement
ffroliva commentedon Jul 16, 2026
Closed automatically by merging #325 to
develop(commit df8f8ea). Live e2e-verified before merge: deliberately set a real Flow project's sticky count default tox3(a mismatch), then requested 1 image viagflow image t2i— got exactly 1 back, noMediaAttributionError. Will ship tomainin the next release.test(e2e): repair #313 agentic e2e setup - toggle into Agent mode first
chore(spike): add issue ffroliva#313 recon for Agent mode's settings …
docs(plan): add implementation plan for agentic image count enforceme…
fix(agentic): enforce image count via Agent settings panel (ffroliva#313
docs(plan): add rework plan for agentic count enforcement (ffroliva#313…
fix(agentic): reuse classic mode's count-tab primitives for ffroliva#313
test(e2e): add live regression test for agentic count enforcement (ff…
fix(probe): council findings — recognizable-arm gate, SHA-pinned actions
feat: selector registry + CI drift probe (#563)
chore(spike): add issue ffroliva#313 recon for Agent mode's settings …
docs(plan): add implementation plan for agentic image count enforceme…
fix(agentic): enforce image count via Agent settings panel (ffroliva#313
Merge pull request ffroliva#325 from ffroliva/feature/agentic-count-e…
docs(plan): add rework plan for agentic count enforcement (ffroliva#313…
fix(agentic): reuse classic mode's count-tab primitives for ffroliva#313
test(e2e): add live regression test for agentic count enforcement (ff…
test(e2e): live classic count-setter regression for ffroliva#404 + re…
test(e2e): repair ffroliva#313 agentic e2e setup - toggle into Agent …