Skip to content

fix: handle stalled and stale full-page captures - #256

Merged
iuyo5678 merged 2 commits into
mainfrom
fix/full-page-capture
Sep 15, 2026
Merged

iuyo5678 merged 2 commits into
mainfrom
fix/full-page-capture

Conversation

@iuyo5678

@iuyo5678 iuyo5678 commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

Full-page capture needs an explicit stopping range when a site keeps its loading indicator visible. Some Windows browser builds also return stale window-surface pixels after programmatic scrolling. This change handles these separately while retaining the shared scrolling, tiling and PNG pipeline.

Capture range and diagnostics (all platforms)

  • Add --scope current to capture the initial CSS document height. Default follow continues to follow appended content. The CLI refuses to save current unless the extension acknowledges the scope.
  • Use the same bounded height calculation for begin, move and inspect, without changing the bottom-settling timers during begin.
  • Report loading_stalled after 30 seconds at an unchanged loading bottom, with an actionable --scope current hint. Preserve distinct cancellation/interruption reasons and progress. Failed captures save no partial image.
  • Keep both bundled skill copies, schemas and documentation in sync. The current scope is a height boundary, not a frozen DOM snapshot.

Windows Agent screenshot source

  • Only Windows Agent captures prefer their existing session renderer. On macOS/Linux, a working captureVisibleTab source is retained; a failed initial probe falls back to the session renderer.
  • Enable compact frame-freshness checks only for that Windows Agent path. Popup captures retain their existing source selection and do not run the new freshness check.
  • Retry a clearly stale exposure twice before returning stale_frame. Layout mismatches and stale exposures have separate consecutive-failure counters, so mixed failures cannot produce the wrong recovery reason. Backends are selected before measuring and never switch mid-image.

Validation

  • Extension: 1,682 unit tests passed; 94 opt-in tests skipped. TypeScript checking, lint and production build passed.
  • Regression coverage includes Windows/macOS/Linux source selection, unchanged Popup behavior, both orders of mixed layout/stale failures, and height growth during begin.
  • Direct source/engine verification in isolated Windows x86-64, headless Chrome for Testing 153.0.8010.36: after a 650 CSS-pixel scroll, native and renderer samples both matched the expected document row. The persistent-loader current capture produced a 1563 × 4800 PNG with zero mismatches in the sampled pixel column across all 4800 rows.
  • Fault injection using a real frozen viewport PNG returned stale_frame after the initial accepted frame, before any repeated rows were written; the renderer-backed capture then completed correctly. This is controlled fault injection: the original spontaneous surface-cache fault did not reproduce on this Chrome build.
  • Limits: macOS real-browser capture, the complete CLI/browser harness and the 125% scale renderer matrix remain unverified locally. Earlier full local Rust testing stopped on two existing Windows Hermes home-path tests; protocol and targeted CLI tests passed. These paths are outside this patch.

@iuyo5678
iuyo5678 merged commit ee5afd3 into main Sep 15, 2026
5 checks passed
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