fix(ce-demo-reel): wait for network idle and reject blank frames#692
Merged
Conversation
Browser-reel tier silently uploaded blank GIFs against React/Next.js SPAs that fetch data after initial paint. Two layered defects: a fixed `agent-browser wait 2000` that fired before fetches resolved, and a stitch pipeline that validated only frame existence, not content. - tier-browser-reel.md: wait `--load networkidle` plus a short buffer; document `--text` and `--fn` for sites with persistent network activity. - capture-demo.py: 20 KB minimum-frame-bytes guard in `_stitch_frames`, configurable via `--min-frame-bytes` (0 disables). Error names the offending frame and points at the network-idle wait. The silicon screenshot-reel caller passes 0 since rendered code frames are predictably small. - tests: regression test for the size guard; existing happy-path stitch tests opt out via `--min-frame-bytes 0` (synthetic 1x1 PNGs). Closes #689
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f6b436279b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The previous error framed every small frame as "page didn't load", which the Codex review flagged as misleading: PNG size is dominated by entropy, so a fully loaded flat-color UI, sparse empty state, or small viewport can legitimately serialize below 20 KB. The new wording leads with the entropy point, names the legitimate small-frame cases, and explicitly calls out --min-frame-bytes 0 (and smaller positive values) as the recovery path.
Merged
michaelvolz
pushed a commit
to michaelvolz/compound-engineering-plugin-windows-version
that referenced
this pull request
Apr 28, 2026
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
/ce-demo-reelpreviously uploaded blank GIFs to catbox without warning when run against React or Next.js apps that fetch data after initial paint. The fixedagent-browser wait 2000returned before the data arrived, so screenshots captured an empty shell, and the stitch pipeline checked only that frame files existed, not that they had real content. The end result was a "successful" run reporting a public URL pointing at a near-empty GIF.Fix
Two layers, so a regression in either still fails safely:
tier-browser-reel.mdnow usesagent-browser wait --load networkidlefollowed by a short fixed buffer for any post-fetch render. Capture tips also recommend--text "<known content>"and--fn "<expression>"for sites with persistent network activity (websockets, long-polling) wherenetworkidlewould never fire.capture-demo.py:_stitch_framesnow enforces a 20 KB minimum per frame, configurable via--min-frame-bytes(set to0to disable). The error names the offending file, its actual size, and points at the network-idle wait. The siliconscreenshot-reelcaller passes0because rendered code frames are legitimately small.A regression test in
tests/ce-demo-reel.test.tscreates a tiny synthetic PNG and asserts the stitch command exits non-zero with a message identifying the file. Existing happy-path stitch tests pass--min-frame-bytes 0since their 1x1 fixtures are not real screenshots.Closes #689.