hermes-agent/gateway
Ben Barclay 96996a55bf
fix(relay): per-platform capability descriptors for multi-platform gateways (#70717)
One relay adapter fronts N platforms on one WS, but the capability surface
(MAX_MESSAGE_LENGTH / message_len_fn) was a scalar from whichever descriptor
resolved the handshake — and the transport's read loop OVERWROTE it on every
descriptor frame (last-writer-wins). A Discord chat on a gateway whose
applied descriptor was Telegram's inherited the 4,096-char cap and over-sent
into Discord's 2,000-char API 400 (observed live: 2,543/2,641-char replies
silently lost while inbound kept working).

- ws_transport: accumulate one descriptor per platform in
  _descriptors_by_platform (exposed via descriptor_for_platform); the FIRST
  descriptor of a connection generation stays the session default instead of
  last-writer-wins; the map resets on re-dial.
- BasePlatformAdapter: new max_message_length_for_chat /
  message_len_fn_for_chat hooks defaulting to the scalar surface (native
  single-platform adapters unchanged).
- RelayAdapter: overrides resolve the chat's platform from _platform_by_chat
  (the same map per-frame egress uses) and look up that platform's negotiated
  descriptor; falls back to the scalar for unknown chats/transports.
- stream_consumer (streaming budget, _raw_message_limit, fallback-continuation
  chunking) + run.py tool-progress limit now resolve per-chat.

Tests: tests/gateway/relay/test_relay_per_platform_caps.py (7) — verified
fail-without/pass-with (all 7 fail with the fix stashed). Relay + stream
consumer suites green (213 + 223).
2026-07-27 14:24:14 +10:00
..
assets
builtin_hooks
platforms fix(relay): per-platform capability descriptors for multi-platform gateways (#70717) 2026-07-27 14:24:14 +10:00
relay fix(relay): per-platform capability descriptors for multi-platform gateways (#70717) 2026-07-27 14:24:14 +10:00
__init__.py
authz_mixin.py fix(gateway): kanban notifier delivery reliability 2026-07-26 16:14:15 -07:00
cgroup_cleanup.py
channel_directory.py fix(slack): resolve channel IDs to human-readable names 2026-07-23 12:01:24 -07:00
code_skew.py
config.py refactor(gateway): gate loop-liveness watchdog via config.yaml, drop HERMES_* env knobs 2026-07-24 16:03:42 -07:00
cwd_placeholder.py
dead_targets.py fix(gateway): add utf-8 encoding to dead target registry 2026-07-24 15:47:12 -07:00
delivery.py fix(gateway): pass encoding="utf-8" to read_text/write_text in update path (#37423) 2026-07-24 15:47:12 -07:00
delivery_ledger.py fix(gateway,tools,agent): close leaked SQLite connections in delivery, delegation, and verification ledgers 2026-07-24 15:55:08 -07:00
display_config.py fix(slack): quiet Slack display defaults — no heartbeat/busy-ack breadcrumbs in channels 2026-07-23 11:34:11 -07:00
drain_control.py
hooks.py
kanban_watchers.py fix(kanban): widen notifier pre-filter to secondary-profile platforms 2026-07-26 16:27:52 -07:00
memory_monitor.py
message_timestamps.py
mirror.py
pairing.py
platform_registry.py
profile_routing.py
readiness.py fix(gateway): close readiness-probe SQLite connection deterministically 2026-07-24 15:55:08 -07:00
response_filters.py refactor(gateway): promote autonomous silence matcher to shared response_filters helper 2026-07-26 16:55:42 -07:00
restart.py
restart_loop_guard.py
rich_sent_store.py
run.py fix(relay): per-platform capability descriptors for multi-platform gateways (#70717) 2026-07-27 14:24:14 +10:00
runtime_footer.py
scale_to_zero.py
session.py fix(compression): recover rotated session lineage 2026-07-24 16:00:34 -07:00
session_context.py fix(gateway): dedupe chat_type wiring after composing #58615 with #60769 2026-07-26 16:01:32 -07:00
shutdown_forensics.py fix: add explicit UTF-8 encoding to all subprocess text=True calls (#53428) 2026-07-24 11:45:57 -07:00
shutdown_watchdog.py refactor(gateway): gate loop-liveness watchdog via config.yaml, drop HERMES_* env knobs 2026-07-24 16:03:42 -07:00
slash_access.py
slash_commands.py feat(approvals): add cross-surface mode command 2026-07-26 21:13:03 -07:00
status.py fix(dashboard): one gateway liveness ladder for status + channels 2026-07-26 08:08:38 -07:00
status_phrases.py
sticker_cache.py
stream_consumer.py fix(relay): per-platform capability descriptors for multi-platform gateways (#70717) 2026-07-27 14:24:14 +10:00
stream_dispatch.py
stream_events.py
systemd_notify.py
turn_lease.py
wake.py fix(gateway): deliver kanban/delegate wake-ups to api_server sessions 2026-07-23 11:55:17 -07:00
whatsapp_identity.py