hermes-agent/tests/tui_gateway
kshitijk4poor 8077e7d2fb fix(tui): narrow resume lock to avoid blocking session.close
The salvaged fix held _session_resume_lock across _make_agent (MCP discovery
+ AIAgent construction, seconds), serializing it against session.close. Since
session.close runs on the main RPC dispatch thread (not a _LONG_HANDLER), a
close racing a mid-build resume would stall all fast-path RPCs (approval.respond,
session.interrupt).

Restructure to double-checked locking: build the agent outside the lock, then
re-check _find_live_session_by_key under the lock before _init_session. A losing
concurrent resume discards its just-built agent (no worker/poller wired yet) and
reuses the winner. Updated the concurrent-resume regression test to assert the
real invariant (one surviving live session + loser agent closed) rather than the
implementation detail of a single _make_agent call.
2026-06-04 08:18:26 -07:00
..
__init__.py feat: add tests and update mds 2026-04-08 19:31:25 -05:00
test_entry_sys_path.py chore: prune unused imports and duplicate import redefinitions 2026-05-28 22:26:25 -07:00
test_goal_command.py test(tui_gateway): stop reloading server module in fixture teardown (#34217) 2026-05-28 18:16:54 -07:00
test_make_agent_provider.py fix(tui): close slash parity gaps with CLI (#20339) 2026-05-05 15:42:39 -05:00
test_protocol.py fix(tui): narrow resume lock to avoid blocking session.close 2026-06-04 08:18:26 -07:00
test_render.py feat: add tests and update mds 2026-04-08 19:31:25 -05:00
test_review_summary_callback.py Add Hermes desktop app (#20059) 2026-05-31 17:46:56 -05:00
test_undo_command.py feat(undo): /undo [N] backs up N user turns with prefill + soft-delete 2026-06-01 01:22:38 -07:00
test_wait_for_mcp_discovery.py perf(tui): stop slow/dead MCP servers from freezing TUI startup 2026-05-30 02:53:37 -07:00