feat: atomic extract-and-connect + stale PR monitor + response audit #4

Merged
m3taversal merged 70 commits from epimetheus/atomic-connect-and-stale-monitor into main 2026-03-30 11:03:35 +00:00
Showing only changes of commit 02c86e9050 - Show all commits

View file

@ -720,7 +720,28 @@ IMPORTANT: Two special tags you can append at the end of your response (after yo
logger.info("Auto-research triggered: %s", query[:80])
# Post response (without LEARNING lines)
await msg.reply_text(display_response)
# Telegram has a 4096 char limit — split long messages
if len(display_response) <= 4096:
await msg.reply_text(display_response)
else:
# Split on paragraph boundaries where possible
chunks = []
remaining = display_response
while remaining:
if len(remaining) <= 4096:
chunks.append(remaining)
break
# Find a good split point (paragraph break near 4000 chars)
split_at = remaining.rfind("\n\n", 0, 4000)
if split_at == -1:
split_at = remaining.rfind("\n", 0, 4096)
if split_at == -1:
split_at = 4096
chunks.append(remaining[:split_at])
remaining = remaining[split_at:].lstrip("\n")
for chunk in chunks:
if chunk.strip():
await msg.reply_text(chunk)
# Update conversation state: reset window, store history (Ganymede+Rhea)
if user: