fix: add error handling to evolution loop telegram notification

Wrap evolution notification in try/except so telegram failures don't
crash the evolution loop. Add integration tests for market close flow.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
agentson
2026-02-14 23:56:04 +09:00
parent 75320eb587
commit e0a6b307a2
2 changed files with 110 additions and 7 deletions

View File

@@ -832,13 +832,16 @@ async def _run_evolution_loop(
logger.info("Evolution loop skipped on %s (no actionable failures)", market_date)
return
await telegram.send_message(
"<b>Evolution Update</b>\n"
f"Date: {market_date}\n"
f"PR: {pr_info.get('title', 'N/A')}\n"
f"Branch: {pr_info.get('branch', 'N/A')}\n"
f"Status: {pr_info.get('status', 'N/A')}"
)
try:
await telegram.send_message(
"<b>Evolution Update</b>\n"
f"Date: {market_date}\n"
f"PR: {pr_info.get('title', 'N/A')}\n"
f"Branch: {pr_info.get('branch', 'N/A')}\n"
f"Status: {pr_info.get('status', 'N/A')}"
)
except Exception as exc:
logger.warning("Evolution notification failed on %s: %s", market_date, exc)
async def run(settings: Settings) -> None: