hermes-agent/tests/gateway/relay
teknium1 43b8ba4181 fix(telegram): preserve Bot API update queue on watcher reconnect
After a prolonged outage the in-process network-error ladder escalates to
fatal and GatewayRunner._platform_reconnect_watcher rebuilds a fresh adapter
that reconnects through the bootstrap path. That path called
start_polling(drop_pending_updates=True), discarding every update Telegram
queued during the outage — all messages sent while the bot was down were
silently lost. The in-process ladder and 409-conflict handler already passed
drop_pending_updates=False; only bootstrap did not distinguish a cold first
boot from a reconnect.

Thread an is_reconnect signal from the watcher through
_connect_adapter_with_timeout into adapter.connect(). The base
BasePlatformAdapter.connect() gains a keyword-only is_reconnect=False so every
adapter inherits a tolerant signature (no per-platform breakage when the
runner forwards the kwarg). Telegram translates is_reconnect into
drop_pending_updates=not is_reconnect on both the polling and webhook bootstrap
calls. Cold boot still drops the stale queue; a watcher reconnect preserves it.

Fixes #46621.

Co-authored-by: annguyenNous <annguyen@nousresearch.com>
Co-authored-by: kyssta-exe <kyssta-exe@users.noreply.github.com>
Co-authored-by: Kewe63 <Kewe63@users.noreply.github.com>
2026-06-25 21:29:57 -07:00
..
__init__.py feat(relay): experimental CapabilityDescriptor schema 2026-06-17 16:37:45 -07:00
stub_connector.py fix(telegram): preserve Bot API update queue on watcher reconnect 2026-06-25 21:29:57 -07:00
test_auth.py feat(relay): connector⇄gateway channel auth + signed-HTTP inbound receiver + enroll CLI (#48147) 2026-06-18 12:01:54 +10:00
test_contract_doc_conformance.py test(gateway): enforce relay contract-doc ⟷ Python conformance 2026-06-17 16:37:45 -07:00
test_descriptor.py feat(relay): experimental CapabilityDescriptor schema 2026-06-17 16:37:45 -07:00
test_descriptor_from_entry.py feat(relay): derive descriptor from PlatformEntry 2026-06-17 16:37:45 -07:00
test_no_stub_leak.py test(relay): assert connector stub never leaks into production paths 2026-06-17 16:37:45 -07:00
test_relay_adapter.py fix(relay): re-attach DM author user_id on outbound for connector egress 2026-06-25 12:43:54 +10:00
test_relay_follow_up.py feat(gateway): token-less follow_up outbound op (A2 capability action) 2026-06-17 16:37:45 -07:00
test_relay_going_idle.py fix(telegram): preserve Bot API update queue on watcher reconnect 2026-06-25 21:29:57 -07:00
test_relay_interrupt.py feat(relay): WS-only inbound on the gateway adapter (Phase 3) (#48294) 2026-06-19 09:33:15 +10:00
test_relay_passthrough.py feat(relay): handle passthrough_forward over the WS (Phase 5 §5.1, gateway half) (#50702) 2026-06-22 20:10:57 +10:00
test_relay_policy_send.py feat(relay): declare relevance policy to the connector + document the management plane (#51248) 2026-06-23 18:43:19 +10:00
test_relay_registration.py test(gateway): live ws-transport round-trip + config-driven registration 2026-06-17 16:37:45 -07:00
test_relay_roundtrip.py feat(relay): transport protocol + test-only stub connector 2026-06-17 16:37:45 -07:00
test_relay_roundtrip_telegram.py test(gateway): Telegram relay round-trip (Phase 1 generalization proof) 2026-06-17 16:37:45 -07:00
test_relay_sheds_crypto.py feat(relay): WS-only inbound on the gateway adapter (Phase 3) (#48294) 2026-06-19 09:33:15 +10:00
test_self_provision.py feat(relay): Phase 5 Unit C — wake primitive (gateway side) (#51595) 2026-06-24 11:00:11 +10:00
test_ws_transport.py feat(relay): terminal 4401 (opt-out) → clean "Relay disabled" state 2026-06-24 18:43:01 +10:00