Fix missing Telegram notification on OpenRouter failover

t-774·WorkTask·
·
·
Created1 week ago·Updated1 week ago·pipeline runs →

Description

Edit

Investigate Ava failover path that should notify Ben in Telegram when provider falls back to OpenRouter. Verify current behavior, reproduce or inspect code path, and fix notification delivery if broken. Add tests where practical.

Timeline (4)

🔄[human]Open → InProgress1 week ago
💬[human]1 week ago

Fixed in commit b0d61b3e. Root cause: failover path in Provider chain had no callback/notification hook, so Telegram never emitted any message when OpenRouter was selected after Claude failures. Added failover event support in Omni/Agent/Provider.hs (FailoverEvent payload + mkStandardChainWithFailoverNotify callback), wired Ava Telegram bot to use it for both normal turns and heartbeat turns, and send a system message to the owner heartbeat chat when selected provider is openrouter after failed attempts. Added tests: Provider callback fires on fallback, does not fire on primary success; Bot notification formatting test. Verified with lint, typecheck.sh on both modules, bild --test Omni/Agent/Provider.hs, and bild --test Omni/Ava/Telegram/Bot.hs.

🔄[human]InProgress → Review1 week ago