[not ready for merge] feat: chain batching, mouse easing, screenshot dedup, network idle#328
Open
petehunt wants to merge 1 commit intogarrytan:mainfrom
Open
[not ready for merge] feat: chain batching, mouse easing, screenshot dedup, network idle#328petehunt wants to merge 1 commit intogarrytan:mainfrom
petehunt wants to merge 1 commit intogarrytan:mainfrom
Conversation
- chain is now the primary interface for browser interactions: executes
actions sequentially, waits for network idle, then auto-appends an
observation block (snapshot -i + page state: URL, title, viewport,
focus, dialog state)
- Write commands (click, fill, goto, etc.) removed from standalone
dispatch — only callable through chain. Server rejects standalone
writes with guidance to use chain.
- click/hover use cubic-eased mouse movement (3-40 steps, 30-300ms)
from tracked position to element center, with locator fallback if
bounding box unavailable
- Screenshot SHA-256 dedup: returns "unchanged" if identical to
previous capture. Hash clears on navigation.
- Network idle auto-wait (1.5s cap) after click
- Read commands deprioritized in docs ("rarely needed — chain
auto-observes")
- 13 new tests covering all four features
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
This PR is not ready to be merged yet. Submitting my first pass of bringing over some of BangOnIt's performance enhancements over to gstack. If you like this direction I can test it more thoroughly and clean up the PR to be ready to merge.
The big idea is to push agents to favor batched interactions with the browser rather than single tool invocations. The reason for this is that every round trip to the model can be expensive and that latency quickly adds up. So most tools have now been combined into
chain.chainnow also auto-observes the state of the browser at the end of the batch, saving another round-trip (waiting for the network to settle, with a timeout).I have also implemented change detection for screenshots which helps a lot when the agent misses its click targets when automating canvas-heavy aps apps.
Finally, the way that Playwright automates user interactions like typing and clicking differs substantially with how humans actually use apps. I've brought over the BangOnIt functionality that keeps a current mouse position and animates the mouse usage in the way a human would
Raw summary below: