Fix premature blocking during incremental scrolling

WU
4d ago
+128-4

Summary

  • include page scroll position and available scroll directions in the Jev state
  • record scroll positions before and after execution so the next decision can distinguish progress from a no-op
  • keep BLOCKED out of the action space while the last scroll advanced and the same direction remains available
  • clarify that scrolling is incremental and add offline coverage for both directions and boundary behavior

Root cause

The snapshot correctly exposed SCROLL_DOWN after the first viewport movement, but the Jev request omitted scroll position and document height. Recent history only said that a scroll changed the page. On a target below the second viewport, Jev therefore selected BLOCKED after one successful scroll even though SCROLL_DOWN remained available.

Verification

Repository checks:

  • uv run ruff check .
  • uv run pytest: 38 passed
  • node --check jev_ultrafast/static/app.js
  • node --check jev_ultrafast/snapshot.js
  • uv build: wheel and source distribution built successfully

Independent local browser benchmark using a Jev-compatible endpoint:

  • reproduction on main: 0/5 scroll-down tasks passed; every run scrolled once and then selected BLOCKED
  • patched branch: 5/5 scroll-down tasks passed
  • scroll-up symmetry: 3/3 passed
  • click, nested-menu, accordion, and select regressions: 12/12 passed
  • missing target at page boundary: correctly returned BLOCKED after reaching the bottom

Summary by cubic

Fixes premature BLOCKED decisions while scrolling through long pages. The agent previously reported BLOCKED after a single successful scroll even though SCROLL_DOWN remained available, so targets located below the second viewport were never reached.

  • Records scroll position before and after each scroll action in history.
  • Sends the current scroll position and available scroll directions in every Jev request.
  • Keeps BLOCKED out of the action space as long as the last scroll moved the page and the same direction is still available.
  • Adds coverage for both scroll directions, no-op scrolls, and page-boundary behavior, and clarifies the incremental scrolling rule.