Repository navigation
feat(computer): capture the screen promptly while a person holds it - #1791
Merged
Merged
Conversation
During a take-over the screenshot stream captures twice a second and once more right after each input, and a frame read that follows an input waits for that capture. The configured interval applies again after the hand-back. Resolves #1787
Contributor
|
🎉 This PR is included in version 0.253.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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
Driving a computer after Take over was slow because the streamed screen was only as fresh as the capture timer: one frame every
computer_use.screenshot.capture_intervalseconds, 3 by default. A client could poll as fast as it liked and still saw a click's result up to 3 seconds later.While a person holds the screen, the worker now captures twice a second and once more right after each input. A
read_framethat follows an input waits up to a second for that capture, so its frame shows what the input did. Outside a hold nothing changes.Resolves #1787
Changes
internal/computer/domain- aScreenFollowerport (HoldChanged,InputLanded) andFollowonScreenControl.internal/computer/screen_control.go- tells its follower when a hold starts or ends and when a person's input has landed. A follower that joins during a hold is told at once.internal/computer/infrastructure/screenshot_server.go- the capture loop runs on a timer it resets to the interval in force and wakes at once on a hold change or an input. An input owes readers a frame, andGetLatestFramewaits for it, bounded by one second.internal/container- the screenshot server follows the screen control.docs/computer-use.mdanddocs/browser-extension-protocol.mddescribe the capture behaviour during a hold.An input that lands while a capture is in flight stays owed for the next capture, so a reader never gets a frame that started before its input.
Testing
task precommit:runandtask testpass. New tests usetesting/synctestfor the pace switching, the capture on input, the reader's wait and its timeout, and cover the follower notifications.Not included
The follow-ups named in the issue, each with an issue of its own: pointer press and release for dragging (#1792), keeping the display controller open for a hold (#1793) and skipping unchanged frames (#1794).
Docs follow-up: inference-gateway/docs#1169.