Repository navigation
fix(flow): parse rpc error envelopes and workflow history - #38
google-labs-stitch[bot] wants to merge 2 commits into
Conversation
- Match flow.google.com and parse HTTP 200 batchexecute error frames - Add LcEY2c, SPrCad, sAVZzc, jeNy9c, and maseQ to generation RPC IDs - Preserve primary clip URLs when workflow history[1..] items fail - Track failed history items so video extend aborts on the next poll
byteland-app
left a comment
There was a problem hiding this comment.
The parser in src/cdp.rs combines errors from all frames into one excerpt. src/generation.rs:291–319 then aborts generation if any generation RPC is listed in the batch URL, even when that RPC succeeded and a different frame failed. Keep frame-level RPC IDs and match them to the expected request and operation. Add a mixed success and failure fixture and cover an er frame with no RPC ID separately.
|
Changes requested.
This PR overlaps with #43 (history parsing), #39, #44, #46 and #28. Rebase after #43 is decided. |
- Keep primary media status and error separate from history failures - Compare watched and scene clip failures against baseline snapshots - Match generation batchexecute rpcids and wrb.fr frames by exact ID - Decode JSPB field offsets and google.rpc.Status arrays from wrb.fr - Read CDP response bodies only for active generation POST responses - Key failed history markers by unique ID or anonymous index
|
Addressed in ca1deec:
Also checked #43 — since it is still open under review ( |
|
Closing this pull request. It conflicts with |
|
Merged |
Summary
Parse Google Flow
batchexecuteRPC error envelopes and inspect full workflow history arrays so generation, character reference upload, and scene video extend operations fail fast with upstream error details while preserving primary media status and download URLs.Changes
batchexecuteJSPB error envelopes (src/cdp.rs,src/engine.rs,src/generation.rs):flow.google.comfromFLOW_URLinis_flow_hostalongsidelabs.googleandaisandbox-pa.googleapis.com.Network.getResponseBodystrictly whennetwork_tx.receiver_count() > 0and the response is a Flow-hostPOSTmatching(status >= 400 && is_generation_rpc_url(url)) || (status == 200 && has_generation_batchexecute_rpc(url)), skipping idle traffic, unrelated 4xx/5xx responses, and non-generationbatchexecutecalls.BATCH_GENERATION_RPC_IDS(includingLcEY2c,SPrCad,sAVZzc,jeNy9c, andmaseQ) as exact comma/%2C-separated tokens on/batchexecuterpcidsquery parameters (has_generation_batchexecute_rpc) and filterwrb.frframes by exactframe[1]RPC ID (is_generation_rpc_id) so co-batched non-generation RPC errors never fail a generation job.wrb.fr(Yp = [2, 9, 10]payload oneof,ic(a, b, Wa)extension-pivot indexing, andgoogle.rpc.Statusarray on field 5) anderbatch error frames (fields 2, 4, 9, 10), suppressing trailingerframes once a generationwrb.frdata frame has resolved in the same envelope.history[1..]failures (ts/types.ts,ts/scene_tiles.ts,ts/read_store_snapshot.ts,src/assets.rs):Uc/Cg,Tc/tg,Oc/Yf) and structural fallbacks, deduplicating workflows per scene tile.media_statusandmedia_errorbound strictly to the tile's primary media (primaryStatus || nullandprimaryError) so an oldhistory[1..]failure never overrides a"pending"or"success"primary media item, while preservingprimary_readyand cold-cacheas29sURL lookups.failed_historymarkers uniquely asid:<cleanId>(orid:<cleanId>#<occ>) andanon:<index>(<key>|<status>|<error>) and deduplicate by<key>inmergeFailedHistorywhile upgrading empty error text.src/scenes.rs,src/generation.rs):failed_history,media_error,primary_media_id, andmedia_status(FlowAsset::new_failure,watch_baseline, andclip_entered_error) so first and repeatedhistory[1..]failures abort on the next 4-second poll tick without false positives on prior failed variants.Verification
RUSTFLAGS="-D warnings" cargo build --release --locked --bin flow-mcp,cargo xtask ci,cargo xtask collect-licenses,cargo deny --locked --workspace check, and./target/release/flow-mcp --headless doctor --json(boq_labs-ai-sandbox-frontend_20261120.00_p0) with zero warnings and all.rsand.tsfiles well below 800 code lines.batchexecutewire format againsthttps://labs.google/fx/tools/flowand ran an out-of-tree headless Chrome + MCP stdio E2E suite verifying primary"pending"->"done"flow_editwith prior failed history, co-batchedcPZSdcerror +Z9cAtfJSPB extension dictionary,sAVZzcwrb.frgoogle.rpc.Statusfast-fail, repeated empty-IDflow_videoextendfast-fail, and CDP wire-levelNetwork.getResponseBodycall counts.Automated PR initiated by user @byteland-app via Stitch Loop.