Skip to content

feat(alerts): hand fired alerts to an AI agent through the webhook and MCP - #131

Merged
btouchard merged 3 commits into
mainfrom
040-agent-loop
Oct 1, 2026
Merged

btouchard merged 3 commits into
mainfrom
040-agent-loop

Conversation

@btouchard

Copy link
Copy Markdown
Contributor

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

  • Every alert now records the host it belongs to (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.
  • The generic webhook payload carries agent_id and url, 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 over docker exec ... --mcp-stdio, with no built-in tools and no user settings.
  • The webhook payload is documented field by field with fired and resolved examples, plus a new AI Agents guide.
  • The README opens on the agent loop: a tagline line, an Agents section before Features (absorbing the MCP section), and an MCP row in the comparison table.

…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.
@btouchard
btouchard merged commit cfccc0e into main Oct 1, 2026
22 checks passed
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