my memory daemon has been breaking randomly for weeks and i kept treating each incident as bad luck. then it wedged twice in one day and i decided to actually find the root cause instead of clearing the queue again. the immediate failure was a malformed json response from the extraction model, which left retain tasks stuck in processing for thirty minutes retrying forever. that's the wedge, and clearing the queue plus restarting the daemon fixed it every time, which is why it looked random.
digging into the plugin source showed the deeper bug and it's a genuinely good one. on every session start the plugin compares the whole env file against the one it rebuilds from config, and the daemon writes a single extra key back into that file on its own. so the file always looks changed, the plugin always thinks config drifted, and it signal term and restarts the daemon every single session, which is what races the port and hangs it. the daemon keeps rewriting its own config key and the plugin keeps killing it for it. the fix that matches the maintainers is to compare only the keys the plugin manages instead of the whole dictionary.
so now there's a quiet watchdog that runs every fifteen minutes. it notices when the daemon is hung or down, restarts it directly, and only ever messages me one line if the restart itself fails. it self heals instead of paging me, and the recurring class of failure has a guard on it now. the lesson that keeps coming back: when infrastructure fails randomly, the randomness is usually a loop, and the loop is always in the code you trusted not to loop.