Skip to content

test(flow): lock the wire envelopes before consolidating the Flow API surface - #46

Merged
crisng95 merged 1 commit into
mainfrom
fix/flow-unify-video-submit
Sep 15, 2026
Merged

crisng95 merged 1 commit into
mainfrom
fix/flow-unify-video-submit

Conversation

@crisng95

Copy link
Copy Markdown
Owner

Groundwork for consolidating the Flow API surface. Tests and dev deps only — no production code changes.

Why

Several contributors migrated to flow.google.com / batchexecute in parallel, and the same Flow call now has multiple implementations. Consolidating them means moving who builds the request envelope, and that refactor has a nasty failure mode: Flow accepts a malformed payload and then quietly ignores it, which is indistinguishable from success. You only find out when the render never arrives.

tests/unit/test_flow_batch.py asserts positions — slot 3 is the seed, slot 5 is the model. A dropped trailing null or a changed constant sails straight through. So these assert the whole envelope string.

Verified, not assumed

Flipping SURFACE_ID 22 → 23 in flow_batch.py — exactly the kind of silent wire change that breaks Flow:

Result
3 new golden tests FAIL — caught it
48 existing position tests PASS — missed it

That gap is what this closes.

Contents

  • tests/unit/test_flow_batch_golden.py — byte-for-byte locks on image_request, video_request, text_video_request, plus a test that video_request passes its model key through untouched (the property that lets one submit serve both Veo and Omni). uuid4 is pinned to a counter; nothing else is mocked.
  • requirements-dev.txt — test deps were undeclared, so a fresh checkout could not run the suite that guards any of this.

New file rather than additions to test_flow_batch.py, to stay clear of #40 and #42, which both touch that file.

Test

218 passed, 3 failed

The 3 failures are pre-existing on main: test_processor.py patches agent.worker.processor._retry_state, which no longer exists. Unrelated to this PR, tracked separately.

Run with --ignore=tests/unit/test_result_handler.py --ignore=tests/unit/test_video_reviewer.py; both have pre-existing environmental problems (the former hangs on a real DB handle, the latter needs an ffmpeg built with drawtext).

🤖 Generated with Claude Code

https://claude.ai/code/session_01DB27wvPQ195KGiQ6VZfCDf

The batch builders are about to gain a caller: Omni will submit through the
same generate_video that Veo uses, differing only by a model key. That refactor
can drop a trailing null and still look fine — Flow accepts a malformed payload
and then ignores it, which reads exactly like success.

test_flow_batch.py asserts positions, and positions survive that. So assert the
whole string instead. Checked by flipping SURFACE_ID 22 -> 23: all three goldens
fail, and all 48 position tests pass.

Also adds requirements-dev.txt — the test deps were undeclared, so a fresh
checkout could not run the suite that guards any of this.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DB27wvPQ195KGiQ6VZfCDf
@crisng95
crisng95 merged commit 9aa0e7c into main Sep 15, 2026
@crisng95
crisng95 deleted the fix/flow-unify-video-submit branch September 15, 2026 16:40
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