Repository navigation
feat(vision): write a capture to a file, at a size, of the whole page - #5
Merged
Merged
Conversation
Agents kept starting their own headless Chrome for screenshots: `vision` returned only an inline image of the viewport, so a PNG deliverable, a capture at a fixed size or a full-page reference had no tool. - `path` writes the PNG to a file and returns the path and pixel size, with no image block. The file is written beside its target and renamed over it; a relative CLI path is the caller's, not the daemon's. - `size` (`WxH[@scale]`) sets the viewport for that capture only and hands it back after, including when the capture fails. The image is exactly that size on any display, and the result says so when it is not. - `full` captures the whole page, measured in the pixels a clip uses so a zoomed page is not cut short, and cut with a note where one capture cannot hold it. - `run` takes `vision` steps, which always save to a file. - A capture is at most 16,384 px on a side and 40 megapixels. The CDP message cap goes from 64 to 224 MiB so that a reply carrying one never closes the browser connection. - A host's note stands in place of the attached-browser note in the MCP instructions; a host on the real lane with a saved attach mode got both, and they contradicted each other. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Chromium reports a page's CSS size rounded down, so at a pixel ratio other than 1 a full capture left out the page's last drawn row or column: a 1000.5px page at a ratio of 2 came back 2000 px tall, not 2001. The clip is now sized from the size the page is drawn at, where the page's ratio accounts for it. Under an emulated ratio the drawn size is not scaled, and the CSS size stands as before. Co-Authored-By: Claude Fable 5.2 <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.
Summary
visioncan now write a PNG to a file, at an exact size, of the whole page, so an agent has no reason to start its own headless Chrome for a screenshot.Type
What changed
Agents with these tools still launched a headless shell for three jobs: a PNG deliverable, a capture at a fixed size, and a full-page reference.
visionreturned only an inline image of the viewport.pathwrites the PNG to a file and returns the path and pixel size, with no image block. The file is written beside its target under a name of its own and renamed over it. A relative CLI path is the caller's, not the daemon's.size(WxH[@scale]) sets the viewport for that capture only and hands it back after, including when the capture fails. The image is exactly that size on any display, and the result says so when it is not.fullcaptures the whole page. It is measured in the pixels a clip uses, so a zoomed page is not cut short, and it is cut with a note where one capture cannot hold it.runtakesvisionsteps, which always save to a file.This changes the
visionandruntool schemas, at the maintainer's request. The tool count stays at 5.CHANGELOG.mdis left for the release.Checklist
cargo clippy --release --all-targets -- -D warningspassescargo test --profile gatepassescargo build --releaseproduces a clean binary (built with--profile gatelocally; CI builds release)feat:/fix:/stealth:/docs:)How it was verified
cargo fmt --check, clippy with-D warnings,cargo test --profile gate(502 lib tests plus the others), and the rename check all pass.@2), 1170x2532 and a full page came back at the exact pixel size, and the viewport was back to its old size after each one, including after a capture that failed.sizetogether withfull.Stealth changes (if applicable)
Not touched.
🤖 Generated with Claude Code