Files
hermes-agent/tests
Teknium f5729bb014 refactor(gateway,tui-gateway): one settlement rule for batch clarify in both registries
Main's sidecar (tui_gateway/server_requests.py) and the session owner
(gateway/session_sudo_prompt.py) each computed a batch clarify's terminal
{answers, outcome} in their own code, and the owner's copy had already
drifted twice (Esc reported as submitted, timeout dropping locked
answers). Both now call tools.clarify_batch.settle_batch(locked,
frame_result, ended=...), a pure function: the last lock, a timeout or an
interrupt/cancel keep the locks with that outcome; a closing frame with
an answers dict lays them over the locks; anything else is a cancel-all
that keeps the locks as cancelled.

One sidecar change comes with it: a closing frame that names its own
outcome (ClarifyResult documents timed_out for the classic CLI's own
deadline) now keeps it, where the sidecar used to overwrite it with
submitted. The owner already honoured it.

Test: tests/gateway/test_clarify_batch_settlement_parity.py drives both
real registries through the same six endings after one lock (red: no
module, then the sidecar's frame_names_its_outcome case; green).

Review finding by @alt-glitch on #140472
Refs #134889 (TUI-18)
Refs #140337
2026-10-17 08:03:51 -07:00
..
…
…
…