Repository navigation
Port observe's pixels option (capturePixels) to the engine session - #915
Merged
Merged
Conversation
…(upstream observe(operation, { pixels, comparable }))
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ls2e1yaZFgZ3FEJkYScfkK
Contributor
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 37 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Member
Author
|
Review of this PR: no code changes. Most findings describe upstream's own design, which the port follows:
|
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.
An observation could not carry the screen's pixels, so the three budget tests of #892 ran the viewport probe and
ScreenshotAsyncinstead of upstream's path and kept aPartial_prefix. The engine session now has upstream'sobserve(operation, { pixels, comparable }), with the screenshot taken under the observation's one budget. The three tests port as written.Upstream change ported:
fix(mobile): bound reads by the operation budget,57f9ed9(e2e-inc/e2e#1464): thecapturePixelsstep ofobserveinpackages/mobile/src/surface.ts(the screenshot shares the budget,OPERATION_TIMEOUTis rethrown, any other failure costs the observation its image), andartifacts.screenshot(label, operation).Public API change:
IEngineSession.ObserveAsync(ObserveOptions? options, TimeSpan timeout, ct),ObserveOptions { Pixels, Comparable }(upstream'sEngineObserveOptions),Observation.Pixels(anEngineScreenshot: upstream'spixelsandmaskedRegionCount), andScreenshotArtifactAsync(label, TimeSpan timeout, ct)onIEngineSessionandDeviceSession. The agent still takes its screenshot throughCapture; it does not readObservation.Pixelsyet.Tests (
Engine/ObservationTests): no partial or skipped tests. 'bounds screenshot by operation budget', 'rethrows OPERATION_TIMEOUT from capturePixels during observe', and 'shares one budget across observe steps so screenshot cannot take a fresh budget' losePartial_. Newly ported: 'captures pixels on request, masks every secure node, and degrades to tree-only when it cannot'. 'holds the status bar in a fixed state for a screenshot taken for comparison, and only then' and 'withholds the pixels of a screen with a secure field when the image cannot be read or decoded' now run throughObserveAsyncwithPixels, as upstream does..NET-only symbols:
ObserveAsync(ObserveOptions?, TimeSpan, ct)andScreenshotArtifactAsync(label, TimeSpan, ct)onIEngineSessiondrop the options/budget, so engines that take none keep compiling.DeviceSession.CapturePixelsAsynciscapturePixels(Asyncsuffix); it does not swallow a caller cancel, where upstream catches every non-timeout error.Docs: SKILL.md, COMPATIBILITY.md, and the regenerated API pages for the touched types.
Closes #908
🤖 Generated with Claude Code
https://claude.ai/code/session_01Ls2e1yaZFgZ3FEJkYScfkK