Files
hermes-agent/tests/tools/test_bot_reply_receipt.py
teknium1 eec5bd6673 Merge remote-tracking branch 'origin/main' into fix/106742-thread-resolution
4,048 upstream commits (Sep 16-23) composed onto the unified gateway runtime by six
per-domain conflict lanes (gateway, desktop/shared, cli/state, cron, bots/tui_gateway, ink).
Retired lanes stay retired (Desktop secondary pool + exit supervisor, deferred Bot Chat
pending queue, subprocess retry adoption); main's gateway.standalone, host-role claim,
clarify capability gate, config-read caches and idle gates ride on top.
2026-09-23 03:25:31 -07:00

19 lines
863 B
Python

"""A relay reply is an immutable delivery receipt, not a last-writer-wins file."""
import json
from tools.bot_relay import write_reply
def test_relay_reply_retry_cannot_replace_a_settled_delivery(tmp_path):
key = 'd' * 32
path = write_reply(tmp_path, key, reply='original')
before = path.read_bytes()
assert write_reply(tmp_path, key, reply='original') == path
assert path.read_bytes() == before
# A replayed envelope's second outcome (or a bookkeeping timeout) never displaces the first
# settled reply — the waiter may already have read it (tests/tools/test_bot_relay.py pins the
# same rule from the drain side).
assert write_reply(tmp_path, key, reply='replacement', error='late', reason='delivery_timeout') == path
assert path.read_bytes() == before
assert json.loads(path.read_text())['reply'] == 'original'