hermes-agent/tui_gateway
Brooklyn Nicholson b11b5ece2e fix(tui): revision-aware reload.mcp — an ack now means the revision was LOADED
Review on #20379, finding 1 (High). Two ways an MCP config revision could
be silently acknowledged without ever being applied:

Client: the poll advanced its accepted mcp_rev BEFORE calling reload.mcp,
and quietRpc collapses failures to null — a reload that failed against a
temporarily broken server left the revision recorded as applied, and no
subsequent poll retried until an unrelated MCP edit. The handshake is now
syncMcpReload(): send the observed rev with the request, advance `accepted`
only when the server answers status=reloaded (to the server's loaded_rev,
falling back to the requested rev on older gateways), and re-compare on
EVERY poll tick — decoupled from mtime — so a transient failure heals on
the next tick. An in-flight guard stops the 5s poll from stacking requests
behind a slow reload.

Server: generation-only coalescing let a follower triggered by revision B
ack against revision A's registry when the config changed under a slow
leader. The leader now re-hashes the MCP-relevant config after discovery
and repeats until stable (bounded), records _mcp_reload_loaded_rev, and a
follower coalesces only when the revision it was asked to load matches —
otherwise it re-runs the full reload itself. Responses carry loaded_rev.

Deterministic tests for the exact failure sequences: failed reload → no
ack, no generation advance; A-then-B overlap → follower re-runs; matching
rev → coalesces; failed leader → follower re-runs; legacy no-rev callers
keep generation-only coalescing (thread ordering via an instrumented lock,
no sleeps). Client: 6 vitest cases on the ack/retry/in-flight contract.
2026-07-21 20:27:15 -05:00
..
__init__.py feat: new tui based on ink 2026-04-02 19:07:53 -05:00
_stdin_recovery.py fix: Windows guard, dedup recovery, profile-safe paths, clear SO_RCVTIMEO 2026-07-20 12:48:50 +05:30
compute_host.py fix(tui): recover from spurious stdin EOF caused by child O_NONBLOCK flip 2026-07-20 12:48:50 +05:30
entry.py fix(tui): gate the shared-owner MCP discovery wait on the stdio TUI flag 2026-07-21 12:43:27 -07:00
event_publisher.py chore: address copilot comments 2026-04-24 12:51:04 -04:00
git_probe.py fix(windows): share one bounded, tree-killing git probe across both call sites (#68997) 2026-07-21 20:18:43 -05:00
host_supervisor.py feat(dashboard): isolate turns in compute host (#65895) 2026-07-16 15:24:03 -04:00
loop_noise.py fix(tui_gateway): suppress WS peer-hangup teardown error flood (#50005) (#54126) 2026-06-28 02:35:01 -07:00
project_tree.py fix(desktop): mirror Windows path identity in live overlay + WSL spelling 2026-07-12 04:33:05 -04:00
render.py tui: inherit Python-side rendering via gateway bridge 2026-04-05 18:50:41 -05:00
server.py fix(tui): revision-aware reload.mcp — an ack now means the revision was LOADED 2026-07-21 20:27:15 -05:00
slash_worker.py fix: Windows guard, dedup recovery, profile-safe paths, clear SO_RCVTIMEO 2026-07-20 12:48:50 +05:30
synthetic_turn.py feat(dashboard): isolate turns in compute host (#65895) 2026-07-16 15:24:03 -04:00
transport.py fix(tui-gateway): harden stdio transport against half-closed pipes + SIGTERM races (#17118) 2026-04-28 17:54:06 -05:00
ws.py fix(tui_gateway): prevent WS disconnect under GIL pressure 2026-06-30 03:11:13 -07:00