Expand description
SPEC_HOST_UI_THREAD_HANG_WATCHDOG_2026_08_14 §1–2 — capture evidence of a wedged host UI thread before anything (a person, usually) kills it.
On 2026-08-14 the host’s UI thread stopped pumping for ~16 minutes with a
window open; it was killed by hand and nothing had captured a stack, so the
deadlock’s cause is still unknown. A deadlock raises no exception, so the
crash handler path can’t see it — the dump has to be taken EXTERNALLY by
another process (what procdump -h does), here the launcher, which already
supervises the host and probes its UI thread (ui_liveness).
Detection + dump only. Automatically killing and respawning a wedged host (spec §1’s last step) is a separate decision and not done here.
Structs§
- Hang
Dump Latch - One dump per hang episode. Feed it
ui_liveness::consecutive_misses()after each probe tick; a reply resets the misses to 0, which re-arms it.
Constants§
- HOST_
HANG_ DUMP_ MISSES - Dump once the UI thread has missed this many consecutive liveness probes.
The probe runs every 60 s (
supervisor/windows.rs), so this is a UI thread silent for at least ~1–2 minutes. Two, not one: a laptop sleep can cost at most one miss (the first probe after resume is answered). - MAX_
DUMPS_ KEPT - Keep at most this many hang dumps; older ones are deleted.
Functions§
- dump_
dir %LOCALAPPDATA%\CrashDumps\agentmux-host-hang\<instance_key>— kept apart from crash dumps (a hang dump and a crash dump mean different things to triage), and one folder per instance (instance_key= the launcher’s data-dir hash) so pruning never deletes another running instance’s evidence (ReAgent P2 on #3913).- dump_
dir_ under dump_dirwith an explicit base.Nonefor a key that isn’t a single plain path component — it is joined onto a path.- dump_
file_ name - Sortable by name: zero-padded timestamp first.
- prune_
old_ dumps - Delete all but the newest
keephang dumps indir. Best-effort.