Conversation
Add send_error_message() + an ERROR_CHANNEL key so transient failures (GraphQL/fetch errors, retries, script crashes) go to a dedicated chat instead of spamming the per-protocol alert groups. Each message is prefixed with a [protocol] label, and falls back to the protocol's own channel when no errors destination is configured so nothing is lost. Reroute the runner crash-alert and the inline operational-error sends across the fleet (aave, fluid, maker, lido, strata, yearn, timelock, morpho, ethena, usdai, apyusd, infinifi, maple, rtoken). Real protocol signals (e.g. morpho "No vaults data", ustb zero-price) stay in their main groups. Also collapse the timelock Envio-unreachable handler, which fanned the error out to every protocol group and referenced an undefined `protocol` on the GraphQL-error path, into a single labelled errors-channel send. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Repoint the runner crash-alert tests and the fluid fetch-error test at send_error_message (the call site they mock changed), and drop the plain_text/disable_notification assertions that are now internal to send_error_message. Add dedicated send_error_message tests covering the labelled errors-chat route, topic precedence, and the fallback to the protocol's own channel when no errors destination is configured. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Operational errors are spamming the main per-protocol alert groups. Example reported on the aave topic:
This came from an inline error send in
protocols/aave/proposals.pythat's caught and reported without crashing, so therun_with_alertcrash wrapper never handled it — it went straight to the aave group.What this does
Adds a dedicated errors channel so transient failures (GraphQL/fetch errors, retries, script crashes) route to one chat instead of the main groups.
Mechanism (
utils/telegram.py)send_error_message(message, protocol)+ERROR_CHANNEL = "errors"key, reusing the existing channel-routing scheme — configure entirely via env vars.[protocol]label so the merged feed shows which monitor produced it.Configuration (see
.env.example)Call sites rerouted (16 files)
utils/runner.py(covers every script viarun_with_alert).aave/proposals.py(GraphQL error + Graph-API-retry failure).send_alert(LOW, …failed)diagnostics in ethena, usdai, apyusd, infinifi, maple, rtoken.Left in main groups (real protocol signals, not noise)
morpho
🚨 No vaults data found, ustb CRITICAL zero-price, ethena MEDIUM stale-data alerts.Bonus cleanup
The timelock Envio-unreachable handler was fanning the error out to every monitored protocol's group (a big spam source) and referenced an undefined
protocolon the GraphQL-error path (latentNameError). Both now collapse to a single labelled errors-channel send.Testing
ruff check✅ /ruff format(no changes) ✅py_compileon all changed files ✅mypy— no errors in the changed files (pre-existing repo errors are unrelated)🤖 Generated with Claude Code