Files
hermes-agent/agent/lsp
kshitijk4poor 6d915fad08 fix(lsp): the LSP server's spawn-ledger write runs off the event loop
register_child writes the spawn ledger: a read-modify-write of the JSON with a liveness check per
row (about 16 ms with 50 rows) under a cross-process file lock that waits up to 2 s while another
Hermes holds it. LSPClient._spawn runs inside async code, so this branch put that work on the event
loop, where main did no ledger write. It now goes through asyncio.to_thread. The handle is stored
first, so a start() cancelled during the hop still kills the server through its error path.

The Raft and WhatsApp bridge spawns in connect() keep spawn_owned on the loop: moving the spawn
into a thread made connect() cancellable after the fork, and a gateway connect timeout then left a
bridge running that disconnect() could not see.

Test: the LSP ledger stand-in fails when it runs on the event loop; fails without the change.
2026-10-29 16:58:09 +05:30
..
…
2026-10-08 19:54:07 +02:00
2026-10-08 19:54:07 +02:00
2026-10-08 19:54:07 +02:00
2026-10-08 19:54:07 +02:00
2026-10-08 19:54:07 +02:00
2026-10-08 19:54:07 +02:00
2026-10-08 19:54:07 +02:00