Skip to content

alerting: resolve infra alerts by editing the open Slack message in place - #140

Merged
Thangnguyenvn98 merged 1 commit into
mainfrom
agent/infra-resolve-edits-in-place
Sep 4, 2026
Merged

Thangnguyenvn98 merged 1 commit into
mainfrom
agent/infra-resolve-edits-in-place

Conversation

@Thangnguyenvn98

@Thangnguyenvn98 Thangnguyenvn98 commented Sep 4, 2026 •

Copy link
Copy Markdown
Collaborator

What changes

An infra episode used to produce two Slack messages: the 🚨 alert, then a separate ✅ resolve. Now the bot edits its own open alert when the episode resolves — the message keeps the original alert text and gains the resolution banner appended below it, so the channel never has stale-looking open alerts.

How

  • Infra notifications already pair as <base>:open / <base>:resolve and the outbox already stores each message's slack_ts.
  • New SlackDeliveryPort.update_message → Slack chat.update, with the same transient/permanent error classification as chat.postMessage.
  • The dispatch path (runtime.py) pairs a …:resolve record with its delivered …:open record and edits it; the resolve row is marked delivered against the original ts.
  • Fallbacks: no delivered paired open (shadow-era open, webhook destinations) or a permanent update failure (e.g. someone deleted the message) → posts a fresh message like today. Transient update failures ride the existing outbox retry/backoff.

Tests

  • test_outbox.py: pairing edits in place (no second post), missing open → fresh post, permanent update failure → fresh-post fallback
  • test_slack.py: chat.update URL/payload contract, message_not_found classified permanent
  • test_infra.py: episode tests updated for the new one-message behavior
  • pytest alerting 202 passed, ruff clean, mypy clean except the known local-venv boto3/stub quirks (identical without this change)

Deploy

Takes effect on the worker after the next install.sh from main. No schema or config changes.

Signed-off-by: Thang Nguyen thang.nguyen@inferact.ai

…lace

A resolve used to post a second message, so every episode left a
stale-looking alert plus a separate resolution note in the channel.
Now the dispatcher pairs infra's '<base>:open' / '<base>:resolve'
delivery IDs: when the open record was delivered via bot token and has
a slack_ts, the resolve chat.update's that message with the original
alert text plus the resolution banner, and the resolve record is marked
delivered against the same ts.

Fallbacks: no delivered paired open (shadow-era open, webhook
destination) or a permanent update failure (deleted message) post a
fresh message as before; transient update failures retry via the
existing outbox backoff.

- SlackDeliveryPort.update_message: chat.update with the same
  transient/permanent classification as postMessage
- runtime: _deliver_or_update pairing helper in the dispatch path
- RecordingSlackPort records updates; protocol gains update_message

Signed-off-by: Thang Nguyen <thang.nguyen@inferact.ai>
@vercel

vercel Bot commented Sep 4, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
vllm-ci-dashboard Ready Ready Preview Sep 4, 2026 12:34am UTC

Request Review

This branch was successfully deployed

1 active deployment
Preview — 82574d61 Deployed Sep 4, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant