Self-hosted · Self-healing ops

Alerts that fix their own bugs.

Monitoring tells you something broke. Coding agents write patches. Nobody owns the part in between — the tests gate, the human approval, the rollback. Ops Copilot owns it: alert → diagnosis → patch → real test gate → approved deploy → auto-close, or automatic rollback.

CI MIT 97 tests passing No database Docker ready
git clone https://github.com/skyzhao1223/ops-copilot.git
cd ops-copilot && npm install
npm run demo:live   # zero config — mock LLM + throwaway repo
Ops Copilot demo — alert intake, AI diagnosis, patch, test gate
The full loop, running locally with no API key: alert → task → diagnosis → patch → real tests.
Why it exists

Every piece exists. The seam between them does not.

🔔

Alerts end at a human

PagerDuty, Keep, Grafana OnCall, Zabbix and Uptime Kuma are excellent at delivering alerts. Then a person starts working — and everything after that is manual.

🤖

Agents nobody dares ship

OpenHands, Claude Code and Cursor can write the fix. What is missing is the gatekeeping: who proves the patch passes tests, who approves the deploy, who rolls back.

🛟

Trust must be designed

Tiered automation instead of promises: human-confirmed by default, tests mandatory, rollback always armed, every step auditable.

How it works

The closed loop

Seven gates, all of them real code paths in this repository — not a diagram of intent.

1
Alert intake
HTTP POST /api/incidents/intake, nginx 5xx log scan, or manual entry. Fingerprint dedupe, P1/P2/P3 classification, 30-minute notification suppression, recurrence detection.
↓
2
Repair task
Acknowledging an incident creates a Goal Runner task — an unattended state machine with constraints.
↓
3
Diagnosis & patch
Cursor adapter or a local agent against any OpenAI-compatible gateway: diagnose → generate a patch → apply it (or wait for approval).
↓
4
Real test gate
Your actual test command runs. Failures are fed back to the agent for up to 3 rounds. This gate cannot be skipped.
↓
5
Deploy gate
Human confirmation by default (L2). Full auto (L1) is an explicit, experimental switch.
↓
6
Health check
Background deploy, then a health probe against the URL you configured.
↓
7
Auto-close or rollback
Healthy → linked alerts close themselves. Unhealthy → the rollback command runs and a human is escalated to.
L1 · unattended (experimental) L2 · human-confirmed deploy (default) L3 · human fallback writes off by default loopback-only by default
What is in the box

Nine modules, zero framework

Incident center

Unified intake, fingerprint dedupe, automatic P1–P3, 30-min suppression, recurrence reopen, five-state machine, auto-close, assignment.

Notify center

Feishu, DingTalk, Telegram and Web Push, routed by severity; a failing channel never blocks the repair loop.

Goal Runner

Design gate → code → test gate → deploy confirm → background deploy → health check, with retry, rollback and pause/resume.

Coding agents

Swappable adapters: Cursor (external) and a local agent on any OpenAI-compatible gateway, with step progress and patch output.

Test gate

Runs your real test command and feeds failures back to the agent — up to three rounds. Not bypassable.

Deploy & rollback

Async background deploy, health probe, automatic rollback on failure, escalation to a human.

Self-check engine

Framework-free capability catalog across security, ops, architecture, data and delivery — with live probes. Reusable, and usable as a CI gate.

EC2 ops base

plan → confirm safety policy and production-instance protection. Useful on its own.

Log scan

Clusters nginx 5xx entries into incidents on a schedule, so alerts can start from logs you already have.

Deliberate non-features: no Next.js, no database, no Kubernetes. Storage is JSON with a file lock and atomic writes; one Node process serves the API and the built UI.

The console

See it before you wire it up

Three pages, one process: alert center, Goal Runner and the project self-check.

Incident center
Goal Runner
Incident detail
Project self-check
Quick start

Three commands to the full loop

① Zero-config demo

npm install
npm run demo:live

Built-in mock LLM and a throwaway git repo — no API key, no account, no database.

② Web console

npm run serve
# http://127.0.0.1:8787

Native Node API plus the prebuilt UI in one process.

③ Docker

cp .env.example .env
docker compose up -d --build

Listens on 0.0.0.0 in the container, published to host loopback only.

Point it at real infrastructure with LLM_API_KEY + GOAL_RUNNER_WORKDIR, then enable the gates you trust: GOAL_RUNNER_TEST_ENABLED, GOAL_RUNNER_DEPLOY_ENABLED, GOAL_RUNNER_ROLLBACK_COMMAND. An optional INCIDENT_INTAKE_SECRET lets monitoring report alerts without holding the admin token.

Positioning

A glue layer and a gate layer

Star counts as of 2026-10. Each project is excellent at its layer — the gap is the seam.

ProjectStarsCoversGap
Keep12.4kAlert aggregation, dedupe, correlation, enrichment, workflow notificationsStops at alert → notification; workflows orchestrate external actions, they do not repair code
Grafana OnCall3.9kAlert → on-call → escalation → multi-channel notifyArchived (last commit 2026-03); schedules humans, does not fix code
OpenHands91kCoding-agent orchestration, webhook and scheduled automationAn agent execution engine: no alert intake, no test/deploy gate
Sentry & error trackers—Error collection, clustering, AI summariesCollect and summarise, never repair
Prometheus / Zabbix / Uptime Kuma—Metrics and availability monitoringAlert only — no agent, no repair

Quality you can check

83 unit tests across 14 files; the self-check engine reports capability state by category and drives the same result through UI, CLI and HTTP.

Small on purpose

Four runtime dependencies (AWS SDK), one process, JSON storage. Clone it on a laptop and understand it in an afternoon.

MIT

Use it, fork it, ship it internally. Issues and PRs welcome — including new agent adapters and monitoring integrations.