HydraIssues

hydracluster: return the session driver and PIN to the head
open unclassified Priority: high Project: hydracluster Parent: #781 Reporter: 14 Oct 2026 20:47

Description

Two small gaps in the XR session read path, both needed by the head client children under #781.

The driver is stored and never returned

handlers_xr.go:154 accepts the driver on session creation, defaults it to alvr, checks it against the body's advertised xr_drivers (:161) and stores it on the session (:184). But xrSessionResponse (:65-72) has no driver field, so the head never learns it.

The head consequence: XrDrivers.launcher(context, sessionDriver) always receives null and falls back to preference order, which lists WiVRn first. It picks the right launcher today by luck. A head carrying both clients and assigned an ALVR body would launch WiVRn against it.

Add driver to xrSessionResponse and to XrSessionState in the head's model. An old cluster omits it, the head reads null, and the fallback keeps working, so the change is backward compatible in both directions.

The PIN has nowhere to live

Carry the PIN the body reports (see the hydrabody PIN child) on the session, and return it on the GET to the head that owns that session and to no other caller. It is a single-use pairing secret.

Empty for ALVR sessions, which have no PIN.

Care

The lesson from v2.0.120 applies to any change here: discovery and claim must default identically. That release accepted any XR-capable body on the eligible endpoint when no driver was named, while session creation defaulted to alvr, and the two disagreed. v2.0.121 fixed it. Do not reintroduce the split.

Done when

GET /api/v1/heads/{id}/xr-session returns the driver and, on a WiVRn session, the PIN. The head selects its launcher from the driver the cluster recorded, not from preference order.

Session Context

Venue
mobile-kit