3 Commits
Author SHA1 Message Date
Hermes Agent 47c3fcf387 Fix stale session load ownership races 2026-07-10 09:26:36 -06:00
nesquena-hermes 8e7d3b086d fix(#3993): add stale-load guard before self-heal so a superseded boot load can't wipe a healthy session (Codex CORE race)
currentSid is snapshotted before the awaited /api/session fetch; if the user
clicks a healthy session while a boot-time restore is in flight and that boot
load then fails non-404, _clearStuckSessionOnBoot(sid, null) would wipe the
healthy session's localStorage/URL. Guard the catch block on
_loadingSessionId !== sid (a newer load superseded this one) — re-arm the active
stream and bail before any self-heal/DOM mutation. Protects both the non-404 and
404 inline self-heal paths. + regression test.
2026-06-11 22:27:01 +00:00
nesquena-hermes 7e341a0d70 test(#3993): cover _clearStuckSessionOnBoot self-heal guards (clears on boot-failure, preserves a live session) 2026-06-11 22:20:57 +00:00