Files
hermes-agent/tests
Teknium b1546920a1 fix(gateway): reopen a finalized local row off the owner loop in the claim
_claim_next called reopen_local_session synchronously. On the first turn of
a finalized local session (TUI shutdown / disconnect / idle stamp) that is
db.reopen_session, a BEGIN IMMEDIATE write; with another writer holding
state.db's lock, every session on the owner loop froze for the writer wait.

The reopen now runs under asyncio.to_thread, still inside claim_gate +
mutation_lock and before the claim. A FIFO head that changed meanwhile is
already fenced by claim_session_input(head=first).

Test (red on r11-base: loop stalled 1.03s):
tests/gateway/test_claim_reopen_off_loop.py::test_reopening_a_finalized_local_row_behind_a_contended_writer_keeps_the_loop_live

Review: sprmn24 sprmn24-P2-residual-reopen
(cherry picked from commit c8362cacca2f1e139b604eeed11e8285b9c542c6)
2026-10-10 22:19:43 -07:00
..
2026-10-09 17:34:38 +02:00
2026-10-10 16:01:32 +02:00
2026-10-08 21:29:48 +02:00
…