feat(alerts): hand fired alerts to an AI agent through the webhook and MCP - #131
Merged
Merged
Conversation
…d MCP Persist the host of every alert (agent_id, migration 40 on SQLite and PostgreSQL) and set it in every alert source. The generic webhook payload now carries agent_id and a url to the alert in the UI, built from the base URL. /alerts/history?alert=<id> highlights and centres that alert, fetching it by id when it is outside the loaded page and keeping it in step with live updates. Add examples/agent-webhook: a receiver that starts a headless Claude Code session per fired alert, restricted to read-only maintenant MCP tools over stdio. Document the webhook payload field by field with fired and resolved examples, add the AI Agents guide, and lead the README with the agent loop.
CloseSend raced with a snapshot still being sent by the spool when the stream ended, which gRPC does not allow.
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.
Make the agent loop real: maintenant detects with fixed rules, pushes the alert, and an AI agent investigates through the built-in MCP server.
Webhook payload
agent_id, migration 40 on both engines), set by every alert source. Swarm, Kubernetes and the infrastructure security score stay on the local sentinel, since they only read the server's own runtime.agent_idandurl, a link to the alert built from the base URL (omitted when that address has no reachable host).UI
/alerts/history?alert=<id>highlights and centres the alert. When it is outside the loaded page it is fetched by id and pinned in the store, so acknowledgements and SSE updates apply to it like any other row.Example and docs
examples/agent-webhook/: a stdlib Python receiver that starts one headless Claude Code session per fired alert, limited to read-only MCP tools overdocker exec ... --mcp-stdio, with no built-in tools and no user settings.