Leaving tool results out of conversation history reads over a relay, and fetching one item when a row is opened

Opening a long conversation on the phone became extremely slow. The latest 500 history items were 19MB, nearly all tool results and arguments. Responses kept failing the relay’s 8MB limit, and the client retried with half as many items each time. After comparing a higher limit, compression and truncation, the history list now leaves tool results out, and the phone fetches the one item a user opens.

October 30, 2026 | 4 min

Binding a sudoers-allowed root helper to SUDO_UID so it cannot register a macOS LaunchDaemon as root

To run a background process on a Mac from boot, you register a LaunchDaemon as root. I split just that step into a root helper, so admins could allow only that helper in sudoers. But the helper wrote the run-as user from its arguments straight into the plist. Pass root, and any binary would run as root at every boot. This post shows how the helper now checks its input against SUDO_UID and the account database.

October 30, 2026 | 4 min

Monte Carlo for a Cone Rotated Twice

A Monte Carlo estimate of the volume of a cone rotated a second time. A million points are placed in a box, in a cylinder, and on a uniform grid, and each estimate is compared with the exact value.

October 16, 2026 | 8 min

setsid Doesn't Save a Child Process from systemd

A self-updating daemon that starts an update helper detached with setsid and then restarts its own service loses the helper too, because systemd decides what belongs to a service by cgroup. In the same way, launchd cleans up by process group, and Go’s exec.CommandContext only kills the direct child on cancel. Results and fixes from four trials on a real systemd 257 and a Go experiment with a grandchild process.

September 28, 2026 | 10 min

Sending Fewer Messages over a Metered Relay

On Cloudflare Durable Objects, incoming WebSocket messages are billed and outgoing ones are not. On a relay like that, the number of messages is something you design. Three ways, with working code and tests: batch events into one frame by time, count and bytes; replace timer polling with change subscriptions and keep the poll as a fallback; and have an idle host drop its connection when nobody needs it.

August 19, 2026 | 10 min

AI Agent Clean Architecture

Why I built an AI agent platform in Go instead of using LangChain, and how Clean Architecture made model, memory, tool, and streaming concerns independently replaceable.

April 7, 2026 | 14 min