HydraIssues

The cluster cannot reach the body screenshot that already exists: add a proxy route
open feature Project: hydracluster Reporter: 9 Nov 2026 13:48

Description

hydrabody already captures its own interactive desktop and the cluster cannot
reach it. Add the route.

What exists

GET /api/v1/debug/screenshot on the body's own server, port 47991
(httpServerPort, pkg/provider/httpserver.go:16). It already solves the hard
part: hydrabody runs in Windows session 0 and cannot capture the interactive
desktop, so it launches a PowerShell helper into the interactive session
through the same WTSQueryUserToken path that launches the kiosk overlay, and
writes a .tmp file then renames it so a reader never sees a partial JPEG.

What is missing

No route on the cluster. Only the two head routes exist
(pkg/api/server.go:479 and :480). So the capture is built and the plumbing
is not.

isTrustedNetwork (pkg/provider/httpserver.go:420) trusts the WireGuard
range and not loopback. Confirmed live on cosmic-pretzel-98: an exec
calling http://127.0.0.1:47991/api/v1/debug/screenshot on the body itself is
answered {"error":"unauthorized"}. So the endpoint is designed to be reached
from the cluster over WireGuard, which is exactly the route that does not exist.

Why this is worth doing before the head side

It answers the question an operator actually has, and it answers it in cases
where no head can:

  • It shows what the experience is rendering, which is ground truth for the
    issue 1152 class, because the body is where the pixels are made.
  • It works for every head type at once: iPad, Quest, Tizen, Android, flatscreen.
  • It works with no head at all, an asleep head, or an unpaired head. On
    2026-11-09 remote work was blocked for about 25 minutes by an iPad that kept
    going to sleep. No head side capture can ever help with that.
  • It cannot disturb a live stream, where a head side capture costs a key frame
    and a second decoder.

Shape

GET /api/v1/nodes/{id}/screenshot, admin gated, proxying to the body's
47991 endpoint over WireGuard and returning the JPEG. The existing flatscreen
head path in handleHeadScreenshot is the closest precedent.

Do this with it, not after it

#1160. The body currently captures a rectangle at the virtual desktop
origin rather than the streamed display. Shipping this route without that fix
gives operators a confident picture of the wrong screen, which is worse than no
picture.

Related

  • #1160 the capture rectangle bug, same work
  • #1152 the overlay class this is the diagnostic for
  • head side video capture is filed separately and is NOT a substitute: it
    answers what the person at the device sees, which is a different question

Session Context

Venue
cloud-seven

Comments (1)

api 13 Nov 2026 11:52

Measured over WireGuard. The route this issue asks for is now justified by a reading, not a guess.

The capture works over the mesh

From a host inside the WireGuard range to cosmic-pretzel-98, hydrabody v2.1.5:

http=200 type=image/jpeg bytes=68357 time=2.307905

Valid JPEG, SOI ffd8ff and EOI ffd9, 1080 x 1920 portrait. It shows a real composited desktop, the experiencenet idle overlay with the logo and the waiting text. Not black, not a stub.

So isTrustedNetwork accepts a caller in the WireGuard range, and the session 0 helper genuinely works. Earlier I had measured only the negative half, that loopback is refused on the body itself. Both halves now agree with the design.

Two design inputs the route must respect

The capture costs about 2.3 seconds. That is the push-a-helper-and-poll path, not a frame grab. It is fine for an operator checking a screen. It is far too slow to drive a user interface in a loop, and the proxy route should not invite that.

The endpoint is NOT uniformly available across bodies. fluffy-dumpling-87, which holds the hydrabody role and is online, did not answer on 47991 at all: a 20 second timeout, no refusal, no error, while cosmic answered in 2.3 seconds from the same host in the same loop.

Why that silence is not the capture code

I checked the obvious explanation and it is wrong. fluffy runs hydrabody v2.0.65 and cosmic v2.1.5, but the endpoint has existed since v1.11.21, so both have it.

captureDesktop cannot hang either. It has a 5 second deadline and returns an explicit error when the helper produces no file. A 20 second silence is longer than the handler can take, so the request never reached the handler.

That points at the listener, and there is a plausible mechanism in the code:

if err := http.ListenAndServe(addr, mux); err != nil {
    log.Printf("[http] server error: %v", err)
}

A failed bind is logged and then ignored. The goroutine returns and hydrabody carries on running normally. So a body can be healthy, online, reporting its service version, and serving no HTTP at all, with the only evidence in a local log line nobody reads. That matches the fluffy symptom exactly, though it is not yet confirmed on fluffy itself.

What this changes for the route

The proxy must not assume the endpoint answers. It needs to tell three states apart and say which one it met:

  • the body has no HTTP server, which is the fluffy shape, and should fail fast rather than inherit a 20 second hang
  • the body answered but the capture failed, for example no interactive session
  • the body returned a JPEG

An operator who gets one generic failure for all three learns nothing, which is the same fault as the 202 that meant queued rather than run.

On the #1160 dependency in the description above

The instruction to ship this together with #1160 should be read with care. #1160 claims the capture takes a rectangle at the virtual desktop origin instead of the streamed display. That mechanism is wrong, and a peer measured it: Windows defines the primary monitor top left AS the virtual screen origin, so the literal CopyFromScreen(0, 0, ...) in the helper does capture the primary monitor.

The narrower worry underneath it survives and is still unverified: the helper captures the PRIMARY monitor, and on a body with a virtual display driver the STREAMED display is not guaranteed to be the primary one. On cosmic they are the same, which the portrait overlay capture above demonstrates. On a body with a different display layout it may not be. #1160 needs rewriting to that claim rather than closing outright.

This is not a blocker for the route.