Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(ce-demo-reel): wait for network idle and reject blank frames#692

Merged
tmchow merged 2 commits into
mainfrom
tmchow/debug-issue-689
Apr 26, 2026
Merged

fix(ce-demo-reel): wait for network idle and reject blank frames#692
tmchow merged 2 commits into
mainfrom
tmchow/debug-issue-689

Conversation

@tmchow
Copy link
Copy Markdown
Collaborator

@tmchow tmchow commented Apr 26, 2026

Summary

/ce-demo-reel previously uploaded blank GIFs to catbox without warning when run against React or Next.js apps that fetch data after initial paint. The fixed agent-browser wait 2000 returned 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:

  • Wait for network idle, not a fixed timer. tier-browser-reel.md now uses agent-browser wait --load networkidle followed 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) where networkidle would never fire.
  • Reject suspiciously small frames before stitching. capture-demo.py:_stitch_frames now enforces a 20 KB minimum per frame, configurable via --min-frame-bytes (set to 0 to disable). The error names the offending file, its actual size, and points at the network-idle wait. The silicon screenshot-reel caller passes 0 because rendered code frames are legitimately small.

A regression test in tests/ce-demo-reel.test.ts creates 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 0 since their 1x1 fixtures are not real screenshots.

Closes #689.


Compound Engineering
Claude Code

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
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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.
@tmchow tmchow merged commit f30404e into main Apr 26, 2026
2 checks passed
@github-actions github-actions Bot mentioned this pull request Apr 26, 2026
michaelvolz pushed a commit to michaelvolz/compound-engineering-plugin-windows-version that referenced this pull request Apr 28, 2026
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.

[compound-engineering] Bug: ce-demo-reel uploads blank GIF silently when page uses async data loading

1 participant