hydrabody already captures its own interactive desktop and the cluster cannot
reach it. Add the route.
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.
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.
It answers the question an operator actually has, and it answers it in cases
where no head can:
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.
#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.
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:
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
isTrustedNetworkaccepts 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.
captureDesktopcannot 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:
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:
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.