Files
hermes-agent/tests/plugins
Teknium 5716f75905 fix(gateway): a reply past the 8-message cap arrives as one file, nothing cut off
Teknium's ruling on #152012 replaces truncation. The earlier commits of this PR cut a runaway
reply at 8 messages and posted a "response truncated" notice; that kept the bot out of a flood
ban but lost the text. Now a Telegram or Discord reply that needs more than MAX_SPLIT_MESSAGES
messages goes out whole as one reply-<id>.md document (localized caption,
platform.shared.response_as_file), and the messages already posted for it are deleted once the
upload is confirmed.

- Non-streamed reply: the gateway's final send (_send_with_retry) uploads the file and sends no
  messages at all (send_long_reply_as_file in gateway/platforms/helpers.py).
- Streamed reply: gateway/stream_consumer_ceiling.py counts every message one reply opens (sealed
  heads, split-first sends, the final edit, fallback continuations). At the cap it stops opening
  messages, waits for the complete final text, uploads it, then deletes the heads and live
  preview. The upload runs shielded so the gateway's flush-window cancel cannot cut it short;
  delivered_final_matches stays True so the gateway never also sends the text.
- Upload refused or impossible: nothing is deleted and the rest of the reply goes out as ordinary
  messages from where the chat left off, paced by the adapters' flood handling. A refused delete
  leaves that message.
- Standalone sends (hermes send, send_message tool, cron) go through the same handoff in
  send_rich_standalone.
- Telegram uploads through send_reply_document (a failure is a failed result, not a text notice
  reported as sent); files over 45 MB are split. Discord gains delete_message and
  send_reply_document (an accepted message without the attachment is deleted again); files are
  at most 7 MB.
- Removed: cap_split_chunks, capped_raw, _split_budget, split_capped/dropped_chars, the rich-part
  cap, the standalone chunk cap and the Telegram response_truncated copy in every locale. Discord
  keeps main's own 8-message truncation only as the fallback when its upload fails.
2026-11-12 22:36:28 -08:00
..
…
…