Phase 3: proactive heartbeat — EventBridge 30min rule, heartbeat-runner Lambda, HEARTBEAT_OK suppression

This commit is contained in:
daniel
2026-05-08 20:14:16 -05:00
parent eddbd98153
commit 01b258579b
16 changed files with 772 additions and 57 deletions

View File

@@ -262,6 +262,10 @@ def handler(event, context):
# Flush any remaining text
print(f'[agent-runner] stream done buffer={len(text_buffer)} bot_token_set={bool(bot_token)}')
if text_buffer.strip() and bot_token:
# Suppress heartbeat OK responses
if text_buffer.strip().upper().startswith('HEARTBEAT_OK'):
print(f'[agent-runner] heartbeat suppressed for {actor_id}')
return
print(f'[agent-runner] flushing {len(text_buffer)}c to {chat_id}')
send_telegram_direct(str(chat_id), bot_token, text_buffer.strip())