Closed general

Log why Hydrogen exited: one [exit] <reason> line on every self-initiated close (window ×, tray Quit, restart_now, updater apply, /app/restart, panic)

John Lauer · 1mo ago ·closed by John Lauer

John, 2026-09-08: "do we log why ah is closed cuz that is a bit scary." Today's case was an external hard kill (adom-bridge#166: another thread's hd_launch); Hydrogen's own log just stopped mid-heartbeat. ab will write the reason into Hydrogen's log before it kills (2.1.76). This issue is Hydrogen's half: every exit Hydrogen itself performs writes ONE line, [exit] <reason>, as the last thing before it goes, so the only exit left without a line is an external kill.

Paths to cover: the window × / Alt+F4 (CloseRequested on the main window), the tray Quit, restart_now (the WSL2 restart card), the updater's apply-staged relaunch, POST /app/restart and /app/relaunch-frontend (with the caller from the control API), an unhandled panic (the panic hook already exists; make sure it lands in the log, not only stderr), and the tao teardown path. Ship it as a tiny change and verify by reading the last line of hydrogen-desktop.log after each of the five user-visible exits.

2 Replies

John Lauer · 1mo ago

Shipped in Hydrogen 1.0.286 (insiders, 2026-09-08 15:48 UTC). Every self-initiated exit now writes one line before it goes: [exit] quit requested / quitting now (tray Quit, or the close button set to quit), [exit] updater: installing a downloaded update, [exit] updater: applying staged update , [exit] restart_now: Windows is restarting for WSL2, [exit] control API POST /app/restart (by thread when the caller names itself), [exit] control API POST /app/relaunch-frontend. Panics already wrote [PANIC]. Verified on ConfRoomROG: POST /app/restart, then the log reads 10:48:57.570 [exit] control API POST /app/restart: kill + respawn (hydrogen#70) followed by the shutdown lines and the relaunch; the box came back on the same build. The only exit left without a line is an external kill; adom-bridge#166 (2.1.76) writes that one from ab's side. Leaving open until that lands so the pair can be closed together.

John Lauer · 1mo ago

Closing. Shipped in 1.0.286: every self-initiated exit writes one [exit] line before it goes, and ab writes the reason for its own kills. The only exit without a line is an external kill from outside both.

Log in to reply.