Both head stream verbs fail on every head, with the same error:
POST /api/v1/heads/node-5e0ea2c8/stream
DELETE /api/v1/heads/node-5e0ea2c8/stream
-> {"error":"exec exited 127: bash: line 1: /root/.hydranode/bin/hydraheadflatscreen: No such file or directory"}
Measured on cranky-toaster-86 (node-5e0ea2c8, Omarchy) on 2026-11-14.
pkg/api/handlers_head.go builds both commands with a tilde:
:592 s.execPollHead(id, "~/.hydranode/bin/hydraheadflatscreen stream-start "+req.Experience, 15)
:743 s.execPollHead(id, "~/.hydranode/bin/hydraheadflatscreen stream-stop", 15)
The exec channel runs as root, so ~ expands to /root. The agent is never installed there. recipes/hydraheadflatscreen-linux.yaml installs it under the DESKTOP user's home:
KUSER=$(loginctl list-users --no-legend | awk '$1 >= 1000 {print $2; exit}')
KHOME=$(getent passwd "$KUSER" | cut -d: -f6)
BIN_DIR="$KHOME/.hydranode/bin"
So the path is only ever correct on a head whose agent happens to live under root's home, which is no head the recipe provisions.
The same recipe step creates exactly what these calls need, for a different reason:
# hydranode's service version check looks in /usr/local/bin.
ln -sf "$BIN_DIR/hydraheadflatscreen" /usr/local/bin/hydraheadflatscreen
Note recipes/hydraheadflatscreen-macos.yaml creates NO such symlink, so a fix that assumes /usr/local/bin alone will work on Linux heads and keep failing on macOS ones. Resolve the binary from a candidate list instead of hardcoding one path.
Until hydra-experiencenet v6.2.1 the kiosk did not pick up a stream it had not started itself (#1192), so this route had no observable success case on a Linux head. Fixing the kiosk made the next fault visible. The verb has presumably been broken since it was written.
DELETE is the only supported way to stop a stream from off box. With it broken there is no way to release a lane remotely, and that compounds with two other faults found in the same run: a body whose lane outlives the stream, and an in-process stream that cannot be stopped through the head's own API. A head can be started and then cannot be stopped.
req.Experience is concatenated into the command unquoted. The route is admin-authenticated and an admin can already run arbitrary commands through the exec endpoint, so this grants nothing new, but the argument should be shell-quoted on principle.
Found by a peer session while running testbook step 10 for #1192.
FIXED and RELEASED as hydracluster v2.4.1. NOT yet live on the server, and not yet proven on a head.
The fix
headAgentCommandin the newpkg/api/head_agent_command.goresolves the agent at run time instead of hardcoding a path, and both call sites inhandlers_head.gouse it:It went wider than the symlink on purpose:
recipes/hydraheadflatscreen-macos.yamlcreates no symlink, so fixing only/usr/local/binwould have fixed Linux heads and left macOS heads failing in the same way for the same reason.With nothing found it exits 127 naming every path it tried. "The agent is missing" and "we looked in the wrong place" produce identical output today and are not the same fault.
Arguments are single-quoted. An admin token can already run arbitrary commands through the exec endpoint so this closes nothing that was open, but an experience name should not be able to change what runs.
Tests
Four, and two of them run the generated script under a real bash, which is the shape that would have caught this. A handler-level test never would, because the handler was correct and the string it produced was not.
$#, and a canary file proves no second command ranFull suite green:
go build,go vet,go test ./...all pass.Docs
The runbook was teaching this bug. It said "always use the full binary path" and then gave the
~form as the example to copy. It now carries a table of where the agent actually lives per platform and points atheadAgentCommandfor new head-side calls. Testbook step 15 gains the three checks that would have caught it: run it against a REAL head, verify the stream appears with nobody touching the machine, and verify a name containing a semicolon stays one argument.State
releases.experiencenet.com/hydracluster/production/latest.jsonreports2.4.1and the binary serves 206 on a range request.serve.go:93isStartAutoCheck(6*time.Hour, true)and the process has been up 14.7 hours, so the next check is roughly 3.5 hours away. No manual deploy was performed.Still to prove
The route has not succeeded over HTTP on a head even once. When the server reports v2.4.1, re-run testbook step 10 in hydraheadflatscreen
docs/testbooks/omarchy-head-e2e.mdagainst cranky-toaster-86 with the stock agent, and both verbs should go end to end. #1192 stays open until that passes.