Files
hermes-agent/hermes_cli
liuhao1024 5ddc5b6b0e fix(cli): concurrent PTY reaps skip already-popped keys
reap_idle() is reached concurrently from attach_or_spawn() and the
background run_reaper loop, and each pop is followed by an awaited
close(); while one reap is parked inside close(), a second reap reaching
the same doomed key hit dict.pop(key) without a default and raised
KeyError straight into the websocket handler. close_all() has the same
overlap window against an in-flight reap.

Pop with a default and skip keys a concurrent reap already removed, so
overlapping reaps are idempotent. Which sessions get reaped is
unchanged.

Fixes #106400

(cherry picked from commit 8ea63a845424263551487886a7526ca2f4bbd1ee)
2026-09-09 11:31:10 -07:00
..
2026-09-07 15:16:44 -07:00