Skip to content

perf(workbot): update a computer's desktop before it pauses, and start it without polling - #7419

Open
reachjalil wants to merge 1 commit into
devfrom
perf/computer-updates-guest-before-first-use
Open

reachjalil wants to merge 1 commit into
devfrom
perf/computer-updates-guest-before-first-use

Conversation

@reachjalil

@reachjalil reachjalil commented Nov 14, 2026 •

Copy link
Copy Markdown
Member

What is this about?

Making a Workbot computer's desktop open sooner after a runner deploy: the new desktop guest is installed while the computer is idle, and a start no longer polls for health.

What problem does it solve?

Every deploy carries a new guest, so the first desktop use afterwards paid for the update. In a hosted runner's desktop timing logs, most slow starts ran start, install, start again and took 9 to 21 s; one resume spent 8 s on six health checks.

What was the situation before?

A start was refused because the guest was older, the guest was installed, and the start was repeated. The runner then asked for the desktop's health up to 30 times, one round trip each. The idle check left an older guest alone.

How is this implemented?

  • desktop.ts: one command returns the desktop's health and, unless it is this runner's version, the computer's image and guest. An older guest is installed first and started once.
  • The start command waits inside the computer for the desktop to answer, within the start's 40 s.
  • checkIdle in computer.ts: once nothing is running, Desktop.update installs the guest before the pause. A running desktop restarts on it; one that isn't only gets the guest. A failure is logged and the computer still pauses. Someone coming back calls the update off.
  • A computer paused before the deploy still updates on its next open. No image file changed.

What else changed?

  • desktop-timing.ts: the combined check is still timed as health.
  • The runner README says when a guest reaches a computer.

Release note

A Workbot computer you have used since an update opens its desktop without waiting for that update.

Evidence

  • src/desktop-guest-update.test.ts — before: start, refusal, install, start, then health checks; after: install, then one start that waits.
  • Same file — before: an idle computer paused with its older guest; after: it pauses with this runner's guest, and is left alone while in use.

…t it without polling

Every runner deploy carries a new desktop guest. A computer's first desktop
use after one asked the helper to start, was refused because the guest was
older, installed the new guest, started again, and then asked for the
desktop's health over and over, one round trip each, until the browser was up.

- A start first asks, in one command, what the desktop answers and what the
  computer was built with. An older guest on this runner's image is installed
  first and started once; a start the helper would refuse is never run.
- The start command waits inside the computer for the desktop to answer, so
  the runner no longer polls. The wait counts against the start's 40 s.
- The idle check brings an older guest up to date before it pauses the
  computer, once nothing is running on it. A desktop that is running restarts
  on the new guest; one that isn't only gets the guest. A failed update is
  logged and the computer still pauses. Someone coming back meanwhile calls
  the update off as they would a checkpoint, and doesn't wait for a pause.
- The health check that also asks for versions is still timed as `health`.

No image file changed, so no computer is replaced and no snapshot is built.

Signed-off-by: Jalil <reachjalil@gmail.com>
@vercel

vercel Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Actions Updated
openwork-app Skipped Skipped Nov 14, 2026 1:32am UTC
openwork-den Skipped Skipped Nov 14, 2026 1:32am UTC
openwork-landing Skipped Skipped v0 Nov 14, 2026 1:32am UTC

Request Review

This branch was previously deployed

3 inactive deployments
Preview – openwork-app — 1814783d Deployed Nov 14, 2026 by vercel[bot]
Preview – openwork-den — 1814783d Deployed Nov 14, 2026 by vercel[bot]
Preview – openwork-landing — 1814783d Deployed Nov 14, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant