Skip to content

feat(computer): capture the screen promptly while a person holds it - #1791

Merged
edenreich merged 1 commit into
mainfrom
feat/capture-while-held
Nov 10, 2026
Merged

edenreich merged 1 commit into
mainfrom
feat/capture-while-held

Conversation

@edenreich

@edenreich edenreich commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

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_interval seconds, 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_frame that 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 - a ScreenFollower port (HoldChanged, InputLanded) and Follow on ScreenControl.
  • 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, and GetLatestFrame waits for it, bounded by one second.
  • internal/container - the screenshot server follows the screen control.
  • Docs - docs/computer-use.md and docs/browser-extension-protocol.md describe 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:run and task test pass. New tests use testing/synctest for the pace switching, the capture on input, the reader's wait and its timeout, and cover the follower notifications.
  • Not verified on a real computer. Capturing twice a second has a CPU cost in the pod that is not measured, and the 500 ms interval is a first choice, not a tuned value.

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.

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
@github-project-automation github-project-automation Bot moved this to Todo in 2026 Nov 10, 2026
@edenreich
edenreich marked this pull request as ready for review November 10, 2026 00:04
@edenreich
edenreich requested a review from a team as a code owner November 10, 2026 00:04
@edenreich
edenreich merged commit 37a3ba0 into main Nov 10, 2026
1 check passed
@edenreich
edenreich deleted the feat/capture-while-held branch November 10, 2026 00:12
@edenreich edenreich moved this from Todo to Done in 2026 Nov 10, 2026
@inference-gateway-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.253.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@inference-gateway-releaser inference-gateway-releaser Bot added the released Shipped in a release label Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Shipped in a release

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[FEATURE] Capture the screen promptly while a person holds it, so take over is responsive

1 participant