tutorial

How to Monitor AutoCodeRover with Vigilmon

AutoCodeRover is an open-source autonomous program improvement agent that takes a GitHub issue, localizes the relevant code using program analysis and AST tr...

AutoCodeRover is an open-source autonomous program improvement agent that takes a GitHub issue, localizes the relevant code using program analysis and AST traversal, proposes patches, and validates them against the test suite — without human intervention. It achieves high resolution rates on SWE-bench by combining LLM reasoning with structured program analysis. When it's healthy, it resolves real bugs automatically. When it's not, patch generation silently fails and issues accumulate.

In this tutorial you'll set up monitoring for a self-hosted AutoCodeRover deployment using Vigilmon — covering task queue health, LLM provider connectivity, Docker sandbox availability, and disk space for patch artifacts.


Why monitoring AutoCodeRover matters

AutoCodeRover runs tasks sequentially as a long-lived background process. Failures are often invisible:

  • Stalled task queue — a task consuming excessive LLM tokens or stuck in AST analysis holds the execution slot indefinitely; subsequent tasks never start
  • LLM API failure — GPT-4 or Claude becomes unavailable; patch proposals stop generating; AutoCodeRover logs errors but the queue keeps accepting new issues
  • Docker sandbox failure — AutoCodeRover validates patches in isolated containers; if Docker goes down, every patch validation step fails silently
  • Disk space exhaustion — patch artifacts, test outputs, and AST caches fill the disk; new tasks fail to write outputs; older tasks' artifacts may be corrupted
  • GitHub API rate exhaustion — issue fetching and PR submission fail; tasks complete patch generation but can't submit results

External monitoring from Vigilmon catches these failures before hours of compute are wasted on tasks that will never complete.


What you'll need

  • AutoCodeRover installed and running (CLI or optional web UI on port 5000)
  • Docker installed (used for sandboxed patch testing)
  • A free Vigilmon account

Step 1: Add a health endpoint

AutoCodeRover is primarily a CLI tool. If you're running it as a persistent service, wrap it with a health endpoint. Here's a minimal FastAPI wrapper that exposes queue and system health:

# acr_health_server.py
import subprocess, shutil, os
from fastapi import FastAPI

app = FastAPI()

def docker_ok():
    try:
        result = subprocess.run(["docker", "info"], capture_output=True, timeout=5)
        return result.returncode == 0
    except Exception:
        return False

def disk_ok(path="/", min_gb=5):
    total, used, free = shutil.disk_usage(path)
    return (free / (1024**3)) >= min_gb

@app.get("/health")
def health():
    d_ok = docker_ok()
    disk = disk_ok()
    status = "ok" if (d_ok and disk) else "degraded"
    return {
        "status": status,
        "docker": "ok" if d_ok else "unavailable",
        "disk_free_gb": round(shutil.disk_usage("/").free / (1024**3), 1),
        "disk_ok": disk,
    }

Run this on port 5001 alongside AutoCodeRover:

uvicorn acr_health_server:app --host 0.0.0.0 --port 5001

Step 2: Monitor the optional web UI (port 5000)

If you're running AutoCodeRover with the web UI enabled, monitor its availability:

  1. Log in to vigilmon.online and go to Monitors → New Monitor
  2. Choose HTTP / HTTPS
  3. URL: http://your-autocoderover-host:5000/
  4. Check interval: 5 minutes
  5. Expected status: 200
  6. Save the monitor

Step 3: Monitor the health endpoint (port 5001)

Set up a monitor for your custom health endpoint:

  1. Go to Monitors → New Monitor
  2. Choose HTTP / HTTPS
  3. URL: http://your-autocoderover-host:5001/health
  4. Check interval: 2 minutes
  5. Expected body contains: "status":"ok"
  6. Save the monitor

When Docker goes down or disk space runs low, this monitor fires and your alert channel notifies the team before the next task attempt fails.


Step 4: Monitor task queue health

AutoCodeRover processes tasks sequentially. Add a queue depth monitor to detect stalled execution:

# Add to acr_health_server.py
import json, pathlib, time

QUEUE_FILE = pathlib.Path(os.environ.get("ACR_QUEUE_FILE", "/tmp/acr_queue.json"))
MAX_TASK_DURATION_MINUTES = 30

@app.get("/queue-health")
def queue_health():
    if not QUEUE_FILE.exists():
        return {"status": "ok", "queue_depth": 0, "active_task": None}
    
    data = json.loads(QUEUE_FILE.read_text())
    queue_depth = len(data.get("pending", []))
    active = data.get("active")
    
    # Check if active task has been running too long
    stalled = False
    if active and "started_at" in active:
        running_minutes = (time.time() - active["started_at"]) / 60
        stalled = running_minutes > MAX_TASK_DURATION_MINUTES
    
    return {
        "status": "degraded" if (stalled or queue_depth > 10) else "ok",
        "queue_depth": queue_depth,
        "active_task": active.get("issue_id") if active else None,
        "stalled": stalled,
    }

Add an HTTP monitor in Vigilmon for /queue-health — alert when body contains "status":"degraded".


Step 5: Monitor Docker sandbox availability

AutoCodeRover validates every patch inside an isolated Docker container. Docker unavailability causes all validation steps to fail.

If Docker is exposed over TCP (port 2375), add a TCP monitor:

  1. Go to Monitors → New Monitor
  2. Choose TCP Port
  3. Host: your-autocoderover-host, Port: 2375
  4. Check interval: 2 minutes
  5. Save the monitor

Alternatively, use the /health endpoint you built in Step 1 — it already checks docker info.


Step 6: Monitor LLM provider connectivity

AutoCodeRover uses GPT-4 or Claude for patch generation and code localization reasoning. Add a connectivity probe:

# Add to acr_health_server.py
import requests, os

@app.get("/llm-health")
def llm_health():
    token = os.environ.get("OPENAI_API_KEY") or os.environ.get("ANTHROPIC_API_KEY")
    provider = "openai" if os.environ.get("OPENAI_API_KEY") else "anthropic"
    
    try:
        if provider == "openai":
            r = requests.get(
                "https://api.openai.com/v1/models",
                headers={"Authorization": f"Bearer {token}"},
                timeout=10,
            )
        else:
            r = requests.get(
                "https://api.anthropic.com/v1/models",
                headers={"x-api-key": token, "anthropic-version": "2023-06-01"},
                timeout=10,
            )
        return {"status": "ok" if r.status_code == 200 else "error", "http_status": r.status_code}
    except Exception as e:
        return {"status": "error", "reason": str(e)}

Add an HTTP monitor for /llm-health with a 5-minute check interval.


Step 7: Monitor GitHub API connectivity

AutoCodeRover fetches issue details and submits PRs via GitHub. Rate exhaustion silently blocks both:

# Add to acr_health_server.py
@app.get("/github-health")
def github_health():
    token = os.environ.get("GITHUB_TOKEN", "")
    try:
        r = requests.get(
            "https://api.github.com/rate_limit",
            headers={"Authorization": f"token {token}"} if token else {},
            timeout=10,
        )
        data = r.json()
        remaining = data["rate"]["remaining"]
        return {
            "status": "degraded" if remaining < 50 else "ok",
            "rate_limit_remaining": remaining,
        }
    except Exception as e:
        return {"status": "error", "reason": str(e)}

Add an HTTP monitor for /github-health with a 5-minute check interval.


Step 8: Monitor disk space for patch artifacts

Patch artifacts, AST caches, and test outputs accumulate over time. Add a dedicated disk monitor:

# Add to acr_health_server.py
@app.get("/disk-health")
def disk_health():
    artifact_dir = os.environ.get("ACR_OUTPUT_DIR", "/tmp/acr_output")
    total, used, free = shutil.disk_usage(artifact_dir if os.path.exists(artifact_dir) else "/")
    free_gb = free / (1024**3)
    used_pct = (used / total) * 100
    return {
        "status": "degraded" if free_gb < 2 or used_pct > 90 else "ok",
        "free_gb": round(free_gb, 1),
        "used_pct": round(used_pct, 1),
    }

Monitor /disk-health — alert when "status":"degraded" before AutoCodeRover starts failing to write outputs.


Step 9: Configure alerting

  1. Go to Alert Channels → Add Channel
  2. Add Slack and email channels
  3. Assign to your monitors

Recommended routing:

| Monitor | Alert | Why | |---------|-------|-----| | Health (Docker + disk) | Slack #oncall | Core sandbox failures | | Queue health | Slack #dev | Stalled execution | | LLM provider | Slack #dev | Patch generation stops | | GitHub rate limits | Slack #dev | PR submission fails | | Disk health | Slack #oncall | Write failures imminent |


Summary: AutoCodeRover monitor checklist

| Monitor | Type | Endpoint | Interval | |---------|------|----------|----------| | Health (Docker + disk) | HTTP | :5001/health | 2 min | | Web UI | HTTP | :5000/ | 5 min | | Task queue | HTTP | :5001/queue-health | 2 min | | LLM provider | HTTP | :5001/llm-health | 5 min | | GitHub rate limits | HTTP | :5001/github-health | 5 min | | Disk space | HTTP | :5001/disk-health | 5 min |

With these monitors in place you'll catch Docker sandbox failures, stalled tasks, LLM outages, and disk exhaustion before they silently waste compute time on patches that will never validate.


What's next

  • Heartbeat monitors — wrap each AutoCodeRover task invocation with a heartbeat ping so you're alerted if the task runner stops reporting progress
  • Status page — publish an internal status page so your team can see current AutoCodeRover health without filing tickets

Get started free at vigilmon.online — no credit card, monitors start running in under a minute.

Monitor your app with Vigilmon

Free plan — 5 monitors, no credit card required. Up and running in 60 seconds.

Start free →