Files
hyprland-headless-stream-pl…/nix
HermenixandClaude Opus 5 c32a2dd2ce fix(mcp): the umask a tool's output deserves, and a websocket refused in its own terms
Three small corrections to the HTTP transport, none of them cosmetic.

**`UMask = "0022"` on the unit, not `0077`.** This unit's tools write
files an operator then reads: `shot --output` and `record` produce exactly
the files the same verbs produce from a shell, and a unit that made them
0600 would be a surprising difference between the CLI and the tool that
wraps it -- the sort that ends with a web server unable to read a capture
and nothing saying why. The authorization table was never protected by
the umask anyway: it is 0600 by an explicit chmod inside a 0700 directory
declared by tmpfiles, which is what actually guards it.

**A non-`http` scope is refused with `websocket.close`**, not with an
`http.response.start` a websocket client cannot read. Nothing here mounts
a websocket so the branch is unreachable today, but an unreachable branch
that would send the wrong frame is a trap for whoever makes it reachable.

**The serialisation this transport widens is written down**, in the module
docstring, in `docs/CONTRACT-mcp.md` §1 and in the TODO that already owns
the underlying limit. `Runner` has always held a process-wide lock,
because the CLI it calls prints to a shared stdout -- but over stdio each
client had its own process, so a call only ever queued behind that same
client's previous call. One process serving many callers makes a stuck
call delay *other people's* agents, and the one who notices is not
necessarily the one who caused it. Latency and never a hang (the event
loop answers a ping throughout), but it changes what the existing
deadline TODO is worth.

Also drops two parameters `_refuse` never used.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KchcvnbfhhZhUHy83YL3Ya
2026-10-11 22:44:53 +00:00
..