Skip to content

fix(flow): buffer RPC errors and probe scene extend state - #35

Closed
google-labs-stitch[bot] wants to merge 1 commit into
mainfrom
stitch/buffer-rpc-errors-and-probe-extend-state-jm0-8f5d3d52-1e9a-425c-afeb-952509887ccb
Closed

google-labs-stitch[bot] wants to merge 1 commit into
mainfrom
stitch/buffer-rpc-errors-and-probe-extend-state-jm0-8f5d3d52-1e9a-425c-afeb-952509887ccb

Conversation

@google-labs-stitch

Copy link
Copy Markdown
Contributor

Summary

  • Include flow.google.com from FLOW_URL (src/config.rs) in is_error_body_candidate (src/cdp.rs) so HTTP 4xx and 5xx responses attach truncated 500-character error_excerpt text.
  • Add LcEY2c, SPrCad, sAVZzc, jeNy9c, and maseQ to BATCH_GENERATION_RPC_IDS (src/generation.rs) to cover all 16 generation, upsample, transform, frame capture, and upload RPCs.
  • Observe batchexecute responses passively across window.fetch and XMLHttpRequest in ts/rpc_errors.ts (registered once per document in ts/index.ts) without mutating page responses, buffering HTTP 200 wrb.fr and er errors in a 64-entry ring buffer with 500-character messages while ignoring internal read-only probes (cPZSdc, as29s).
  • Drain buffered RPC errors in generation polling (src/generation.rs), characterMediaOp (check_upload and check_look in ts/character_media.ts, with zero changes to src/characters.rs), and videoOp (poll_extend in ts/video_ops.ts).
  • Scan full media history arrays (history[1..]) in readStoreTiles (ts/read_store_snapshot.ts) and preserve primary URL resolution for succeeded tiles in populate_missing_media_urls (src/assets.rs).
  • Capture workflow history baselines in prepare_extend and inspect live workflow history entries in poll_extend (ts/video_ops.ts) and run_video_extend (src/scenes.rs) so first and repeated immediate workflow failures exit on the next poll cycle instead of stalling 420 seconds.

Verification

  • Ran cargo xtask ci (CI: OK across cargo fmt, cargo xtask check, TypeScript type checks, esbuild bundle, cargo clippy -- -D warnings, cargo doc --document-private-items, cargo build, and cargo deny).
  • Verified the compiled flow_runtime.js bundle in headless Google Chrome across fetch and XMLHttpRequest wrb.fr and er interception, 64-entry and 500-character caps, maseQ character upload failure reporting, primary media URL preservation with history[1..] errors, and first and repeated immediate scene extend failures.

Automated PR initiated by user @byteland-app via Stitch Loop.

- Read HTTP error bodies from flow.google.com and add five RPC IDs
- Buffer HTTP 200 wrb.fr and er errors up to 64 entries of 500 chars
- Drain buffered RPC errors in generation, character, and video polls
- Scan workflow history errors while preserving primary media URLs
- Probe scene workflow history in poll_extend to fail fast on errors

Copy link
Copy Markdown
Contributor

ts/rpc_errors.ts:275–292 attaches every requested RPC ID to each wrb.fr failure. In a local mixed-batch check, an unrelated RPC failed and drainRpcErrors reported it for a successful generation RPC. Use the explicit RPC ID from each response frame and keep request attribution. Closing this browser interceptor approach. Please carry a request-scoped parser forward in #38.

@byteland-app
byteland-app deleted the stitch/buffer-rpc-errors-and-probe-extend-state-jm0-8f5d3d52-1e9a-425c-afeb-952509887ccb branch November 25, 2026 07:47
@google-labs-stitch

Copy link
Copy Markdown
Contributor Author

Acknowledged — ts/rpc_errors.ts:275–292 merged all rpcIdsFromReq into rpc_ids on every wrb.fr error frame, which allowed an unrelated failure in a mixed batchexecute batch to match a succeeded generation RPC in drainRpcErrors instead of scoping each wrb.fr failure to its explicit frame[1] RPC ID while keeping request-level attribution separate.

Leaving PR #35 closed as requested so the request-scoped per-frame parser approach continues in #38.

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