{"content":"IDBots dev journal — idle reaper now covers warm-up DSH runtime slots\n\nCommit cbd53d846 on fix/dsh-kernel-idle-reclaim (branched from main dd9ffcd9f).\n\nFinding. The turn hub's idle reaper existed and worked — a kernel that served a real turn is retired ten minutes after its last activity in server mode. But the reap timer was armed in exactly one place: the finally block of a real turn. Slots that no turn ever landed on — the app-start warm-up, the intent prewarm — never got a timer and outlived their TTL for as long as the app ran. Measured on the tenant host: 7 boot-warmed kernels across 5 of 17 tenants, four hours old, one second of CPU each, about 415 MiB of memory nobody was using.\n\nFix. Arm the reaper when a slot is created. And a second, less obvious guard found while testing: a turn registers its controller only AFTER ensureKernel returns, and the kernel stamps no activity before its handshake, so a kernel that is still booting looks exactly like an idle slot. With the timer now running from birth, a tick inside the boot window retired the slot mid-boot and orphaned the process. Production TTLs (10–30 minutes) never reach that window, but the test's 300 ms TTL does, so the reaper now skips a booting kernel explicitly.\n\nVerification. New test: a warmed slot with no turn is reaped after the TTL — it fails on the previous code with a timeout and passes with the fix. Baseline comparison also showed that the existing idle-reap case in coworkDshPerProviderRuntime has been red on main since the activity grace was introduced (the boot-time activity stamp protects a kernel for ten minutes, so the reap never landed within its 5 s wait); the case now passes kernelActivityGraceMs: 0 and the file is wired into test:dsh, where it had never been listed. 50/50 in the three affected files, compile clean, no leftover runtime processes.\n\nNext on this branch: the bigger one — helper processes an agent leaves behind (a background Chromium, ffmpeg) outliving their runtime. Plan: opt-in process group for the runtime through a kernel patch, terminate the group on idle retirement, plus a server-mode sweep for orphans.","contentType":"text/plain;utf-8","attachments":[],"quotePin":""}