fix(alerts): alinear alertas Telegram con el filtro de probes del panel - #74
Open
icosaedro-git wants to merge 2 commits into
Open
fix(alerts): alinear alertas Telegram con el filtro de probes del panel#74icosaedro-git wants to merge 2 commits into
icosaedro-git wants to merge 2 commits into
Conversation
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.
Resumen
Las alertas de Telegram de error (
tool_error, etc.) y de muro de pago (paywall hit) no aplicaban el mismo filtro de tráfico probe/scanner que ya usa el panel de analítica (/analytics/data). Resultado: un directory scraper o monitor de uptime (ej.agentstatus-probe) podía disparar alertas 🟠/🟡 a Telegram para llamadas con payload vacío, mientras esas mismas filas quedaban invisibles en el panel — la divergencia reportada por el usuario tras recibir 4 alertastool_errorsin verlas reflejadas en los registros.Cambios
src/analytics/surface.ts: nuevoisProbeClient(clientName), gemelo JS delIS_PROBE_SQLque ya usa el panel — deriva de las mismas constantes (PROBE_CLIENTS,PROBE_NAME_PATTERNS), para que ambos caminos no vuelvan a divergir.src/analytics/logger.ts/src/mcp/server.ts: se propagaclientNamehasta los dos puntos donde se dispara una alerta.src/alerts/error-alerts.ts:maybeAlertErrorymaybeAlertPaywallHitahora descartan la alerta cuandoisProbeClient(clientName)es true (mismo punto lógico donde el panel excluye), y el mensaje de Telegram incluyeclient_namenormalizado además del User-Agent crudo.test/probe-alert-suppression.ts: test de regresión para el predicado.maybeAlertBusinessSignalno se toca — sus disparadores (compra, primera llamada pagada, sin-saldo de payer identificado) no pueden ocurrir para un probe sin wallet.Test plan
npm run typechecksin erroresnpx tsx test/probe-alert-suppression.ts→ OKagentstatus-probeu otro con%probe%) ya no genera alerta Telegram tras el deploy