← Blog

Five crashes and a stop button

November 29, 2026 · Inside OnePress

The same day our friend was iterating her bracelet video, she kept having to type "please continue." She thought the model was flaky. The server logs told a different story: she had hit three unrelated bugs in one afternoon, and one of them was taking the whole service down with her.

Crash one: the Stop button was lethal. Every time a run was interrupted — her pressing Stop, or her connection dropping — an abort fired somewhere downstream, and nothing was waiting to catch it. The unhandled rejection killed the process. Five times in one day. Fail-fast is our design religion and it was working exactly as intended — on the wrong target. An abort is expected control flow, not a bug. Now abort-shaped orphan rejections are logged with their full stack, but they don't kill anyone; every other kind of rejection still crashes the process, because that's how you find real bugs.

Crash two: three of her rounds vanished. The model had emitted a raw NUL byte — and once, half of a UTF-16 surrogate pair — inside its output. Postgres jsonb refuses both, so the entire round failed to persist with "unsupported Unicode escape sequence." The fix: sanitize before the write. Strip NUL bytes and lone surrogates, keep real characters (🚀 survives), and log how much was cut rather than dropping the round.

Crash three: the timeout that wasn't. Her ffmpeg assembly "timed out" — except it hadn't. The bash tool allows 30-minute commands, but the agent's tool-drain watchdog was set to 180 seconds. The drain fired mid-render, declared the call failed, and left ffmpeg burning CPU in the background as an orphan. The video file actually finished; she just never saw the success. Now the drain budget exceeds the bash cap, and after a user presses Stop it grants only a ten-second grace window to collect the dead.

Which raised the real question: what is a timeout for? It protects against stopped, not long. A 40-minute encode writing progress lines is a healthy long task; a 30-second deadlock is already pathological. So bash now runs an idle watchdog: a process is killed only when it has produced no output and its whole process group has burned no CPU for ten minutes. Silent-but-computing is safe — that ffmpeg -loglevel error encode survives. Silent-and-frozen dies fast. In exchange the wall-clock limits got generous: fifteen minutes by default, sixty at most, because the thing doing the killing is no longer a number on a clock.

The honest residuals, since this is that kind of post: a CPU-spinning infinite loop still looks alive to the watchdog and dies at the hour mark — we can't tell useful math from useless math, and chose not to try. And we still haven't found which promise is orphaned in the stop path; it logs its stack now, so the next occurrence will tell us.

All of it shipped the same week. The lesson isn't "we fixed three bugs" — it's that one patient seller doing real work is worth more than a month of synthetic testing. Every failure mode she hit was load-bearing under exactly the workload we claim to serve. She got her video. We got a better pipeline. Fair trade.

Reading this and have thoughts?

Spot a mistake, disagree, or want a follow-up? Tell us — a human reads it.

Inside OnePress — the build log

More posts like this, plus the weekly AI digest, straight to your inbox.

Get the build log in your inbox →