Agent Ops
Technical Overview
agent-ops is a suite of focused, autonomous server-automation agents designed to manage and safeguard VPS infrastructure. Its flagship watchdog agent, doctor, operates on the zero-tool diagnostic principle: all metric extraction, classification, and alerting side effects are handled deterministically in TypeScript, while the LLM is invoked strictly as a read-only reasoning engine with zero execution privileges.
Technical Flow & State Pipeline
[ Cron Trigger (Hourly) ]
│
▼
[ Vitals Collector ] ──▶ CPU load, RAM MemAvailable, swap pressure, df disk, systemd units, HTTP ping
│
▼
[ Classifier Engine ] ──▶ Evaluates thresholds, delta spikes, & flapping dampeners (config.ts)
│
┌─────┴────────────────────────┐
▼ (Verdict: GREEN) ▼ (Verdict: ANOMALY)
[ Fast Exit ] (0 tokens, $0) [ LLM Diagnostician ] (Zero-tool prompt: root cause & risk analysis)
│
▼
[ Fingerprint Hasher ] (SHA-256 metric dedup)
│
▼
[ GitHub Issues API ] ──▶ Opens/Updates issue on failure
└── Auto-closes issue on recovery
- Deterministic Vitals Collection: A lightweight TypeScript runner queries OS state directly via Node standard builtins and native system utilities: 1m/5m/15m load averages, memory margins (
/proc/meminfo), swap activity, disk usage (df), systemd unit active states (systemctl is-active), and external HTTP endpoint health. - Config-Driven Classification: Rules in
config.tsgovern incident boundaries without touching code paths. Includes rate-of-change deltas and flapping dampening to prevent intermittent transient network blips from triggering false alarms. - Zero-Tool LLM Diagnostic Layer: The model (
glm-5-turboor Claude via Pi AI) holds zero execution tools, no shell permissions, and no database credentials. It receives a sanitized JSON snapshot of the anomaly and returns a structured diagnosis identifying the probable root cause, impact severity, and recommended human actions. - Fingerprint Deduplication & Lifecycle Sync: Generates a stable cryptographic fingerprint of the alert signature. If an issue remains unresolved across multiple cron runs,
doctorupdates the existing GitHub thread rather than spamming duplicate issues. When all metrics return to normal, it writes a recovery comment and automatically closes the issue. - Isolated Testing Fixtures: Features a comprehensive suite of offline JSON fixtures (e.g.
disk-90.json,ram-exhaustion.json) allowing L0 classifier tests and mock diagnostic runs without touching live servers.
Tech stack
Architecture
agent-ops/
├── agents/
│ └── doctor/ # Flagship VPS health watchdog
│ ├── config.ts # Threshold policies, watched units, & endpoint configs
│ ├── src/
│ │ ├── vitals.ts # Deterministic OS metric collector
│ │ ├── classifier.ts # Threshold, delta, & flapping evaluator
│ │ ├── agent.ts # Zero-tool LLM diagnostic reasoning wrapper
│ │ ├── github.ts # GitHub Issues REST client & fingerprint dedup
│ │ └── index.ts # CLI entry point & cron orchestrator
│ ├── fixtures/ # Offline metric snapshots for deterministic test suites
│ └── test/ # L0 unit tests for classification rules
├── run.sh # Shell wrapper with --dry-run & fixture flags
├── package.json # Manifest (Node native type stripping, minimal deps)
└── README.md