Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions nerve/channels/telegram.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,9 +563,13 @@ async def send(self, message: OutboundMessage) -> None:
self._cache_message(sent.message_id, chat_id, chunk)

def format_response(self, text: str) -> str:
"""Truncate for Telegram if needed."""
if len(text) > MAX_MSG_LEN:
return text[:MAX_MSG_LEN - 20] + "\n\n... (truncated)"
"""Return text unchanged.

Long messages must NOT be truncated here: send() already splits text into
MAX_MSG_LEN-sized chunks and delivers them as sequential messages. Truncating
first (the old behaviour) defeated that chunking and dropped the tail of long
replies with a "... (truncated)" marker.
"""
return text

# ------------------------------------------------------------------ #
Expand Down
Loading