Dashboard › opencode › Distillation
7f68561c-b7cb-4db5-977d-e587ac13bae0["lore_tm_v1_JVdW09I3sP9azQ-c5GEGS7Ug59vZEv7B6Z0z1KjCses"]
Date: Sep 8, 2026
/home/byk/.local/share/opencode-v2-pilot/supervisor/cmd/client/main.go defines inherited descriptors socketFD = 3 and cwdFD = 4; main() calls sendStart(socketFD, cwdFD, os.Args[1:]), prints errors to stderr, and exits with status 1 on failure.sendStart() marks both inherited descriptors close-on-exec, uses unix.Getpeername(socket) to ensure fd 3 is a connected socket, and uses unix.Fstat(cwd) plus stat.Mode&unix.S_IFMT == unix.S_IFDIR to require fd 4 to be a directory.sendStart() passes the cwdās exact Stat_t.Dev and Ino values into decodeStart(), encodes the resulting protocol.Start with protocol.EncodeStart(), and wraps it in a protocol.TypeStart frame via protocol.MarshalFrame().unix.SendmsgN(socket, packet, unix.UnixRights(cwd), nil, unix.MSG_NOSIGNAL); if the initial send is partial, it writes the remaining packet bytes with unix.Write(), returning syscall.EIO if a continuation write reports zero bytes.decodeStart(values, device, inode) requires 2 through protocol.MaxArgs+2 metadata values. It parses values[0] as a base-10 unsigned 32-bit runtime and rejects parsing failures or values above protocol.MaxRuntimeSec.a; the remainder must use only raw URL-safe Base64 characters [A-Za-z0-9_-], fit the encoded size bound, decode successfully with base64.RawURLEncoding, and round-trip to the identical canonical encoding.decodeStart() applies protocol.MaxCommandSize to the first decoded item and protocol.MaxArgSize to each later item, rejects NUL bytes, and limits the aggregate decoded size of arguments excluding the command to protocol.MaxArgsSize.protocol.Start{Device: device, Inode: inode, RuntimeSec: uint32(runtime), Command: decoded[0], Args: decoded[1:]}.